Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
6.2.0 Beta1
Description
If QML has to do an "implicit conversion" in order to set a property's value, it should really check that the result of the conversion is legitimate, otherwise it should emit a warning. Only warnings about assigning "undefined" seem to be emitted.
Object { property color c: "foobar" // "foobar" is not a valid color; should warn property int i: NaN // not representable, should warn property int i2: Infinity // ditto property int i3: 3.14 // heck, I'd even claim that *this* should warn. }
Here's a more complex example:
Object { property int p: otherObject.doesNotExist + 1 Object { id: otherObject } }
This does not emit a warning (although it should) on accessing the non existant property because of QTBUG-85069.
If one omits the +1, one gets a warning: "unable to assign undefined to int". Makes sense.
But with the +1, undefined+number => NaN, and then the warning disappears. Instead, it should emit ANOTHER warning: you can't set NaN to an integer.