Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
5.15.0, 6.2
Description
There are several cases in which an initialisation together with property declaration is not allowed, but a subsequent binding is ok.
I fear this is due to inconsistencies arising in the grammar, but currently
type with <> -> initialisation is expected to be an object list
type without <> -> initialisation can be object or sort expression.
default and required and readonly limit this further.
If no inconsistency arises then I feel that we should (from the grammar point of view) always allow all kind of initialisations, and warn later about them.
The current state requires strange checks (see https://codereview.qt-project.org/c/qt/qtdeclarative/+/373578 ) Some of the non allowed things in the initialisation are (but allowed when split) are:
property list<Item> myList: Item{}
property var arrayNoMerge: [Item {}, Item\{ nr: 2 }]
default property list<Item> nonMergeable: [Item {}, Item\{ nr: "II" }]