Priority: Not Evaluated
Affects Version/s: Qt Creator 4.15.2
Fix Version/s: None
Component/s: Quick / QML Support
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.
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.
No errors. At most a warning, but I'd prefer nothing at all.
String value expected. (M5)
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?