Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
Qt Creator 4.15.2
-
None
Description
Summary
Qt Creator shows red error annotation about expected types of a generic var property binding, when it's actually not an error, but at most a soft warning.
Steps to reproduce
1. Create a QML component, and add a var property to it, e.g. property var con.
2. Bind a primitive value to it right at the declaration, e.g. property var con: "Yahaha!"
3. In another component, instantiate that component defined in step 1.
4. Bind to that property a value of a different primitive type, e.g. con: 42.
Expected result
No errors. At most a warning, but I'd prefer nothing at all.
Actual result
String value expected. (M5)
Side note
I found it hard to reproduce. Seems to trigger consistently with string/int pairs.
Maybe it's not actually an imaginary type inference, but just a cached property type? Maybe then, the cache uses names as an index/key, so changes to types may not get propagated immediately?