pureqml/qmlcore

Cannot refer to another constant class in a constant class.

paiext opened this issue · 1 comments

The constant implementation is working well :)
However, there is a minor issue as follows.

Example:

[app.qml]
Rectangle {
    width: UiConstants.Width;
    height: UiConstants.Height;    
}

[UiConstants.qml]
Object {  
  const int Width: SomeConstants.Width;
  const int Height: 502;
}

[SomeConstants.qml]
Object {  
  const int Width: SomeConstants.Width;
  const int Height: 502;  
}

Error Message:
parsing src\UiConstants.qml ... src.UiConstants
src\UiConstants.qml:2:3: error: Expected "}", found 'c' (at char 13), (line:2, col:3)
const int Width: SomeConstants.qml;

constant.zip

In order to fix that we need to implement dependency tracking for prototype-level consts, which is not currently possible/feasible to implement. I'm really sorry about that. We can only allow json-like-values to be const