Priority: P2: Important
Affects Version/s: 5.7.0
Fix Version/s: None
Component/s: Quick: Core Declarative QML
There appears to be some kind of checking for infinite recursion in the cases of QML elements self or cross reference, but it doesn't output anything meaningful in the console - there is no error, no warning, no crash, no window, no nothing.
What is worse, this prevents code from running even if it isn't the case of infinite recursion, take this trivial example:
There is no possibility of infinite recursion here even though there is cross reference between the two elements, since whether or not a delegate is going to be created is determine by the model, which stops the propagation of infinite recursion.
Note that this behavior is likely triggered by the "compiler" rather than the runtime, as removing the "literal" reference from the source does the trick, either one of the solutions:
Last but not least, there is also this little gem:
Which does actually complains that "Obj is instantiated recursively" but it really isn't, this time the check produces some output, but it is erroneous, as Obj is most definitely NOT instantiated recursively. The check catches the "literal" self-reference when it is used in the context of a type, without actually instantiating an object and even though QML object properties are actually implemented as references. It would work if the type is changed to Item, but then you lose all the "intellisense" for the otherwise very handy dynamic scope property, you'd be stuck with an Item without the functionality, defined in Obj.
What needs fixing:
1 - the check should not catch QML types when they are used in the context of property types
2 - the check should not catch QML types which are inside a delegate, being inside a delegate outta be enough to imply it is not the case of a newbish accidental infinite recursion
3 - when the check catches an actual case of infinite recursion, it should display a warning or error rather than absolutely nothing