-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.8.4, 6.9.1
-
7fa397156 (dev)
When return type is annotated, return value from a function like below
function makeMyCustomTypes(): list<MyCustomType> { return [root.myCustomTypeComp.createObject(root, { "myPropA": 7 })] }
cannot be correctly assigned to a property of same type (list<MyCustomType>). The assignment would always result in:
[null]
being set as the value of the property.
Steps to reproduce the issue:
- Run the attached project
- Observe the output
Some observations:
- The object within the array is of correct type. This can be confirmed with "instanceof MyCustomType).
- Removing the return type annotation from the function fixes the issue.
- Replacing the return type with e.g. list<BLABLA> seems to work.
- Adding "pragma FunctionSignatureBehavior: Ignored" fixes the issue.
For Gerrit Dashboard: QTBUG-140690 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
681493,1 | QtQml: Fix assigning to QML-defined list properties | 6.10 | qt/qtdeclarative | Status: NEW | 0 | 0 |