<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qt/qtdeclarative.git/tests/auto/qml/qmllint/data/numberToStringProperty.qml, branch dev</title>
<subtitle>Qt Declarative (Quick 2)
</subtitle>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/'/>
<entry>
<title>qmllint: Warn about assigning numeric types to strings</title>
<updated>2021-12-07T20:51:52+00:00</updated>
<author>
<name>Fabian Kosmale</name>
<email>fabian.kosmale@qt.io</email>
</author>
<published>2021-12-06T15:48:41+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=7917b7ad6435b9a340f8c748b17f6ddcc5732544'/>
<id>7917b7ad6435b9a340f8c748b17f6ddcc5732544</id>
<content type='text'>
While it is generally possible to assign a numeric to a value of string
type, this is not the case for literal bindings: There, the engine's
QQmlTypeValidator notices the mismatch, and rejects the program.
Bring qmllint in line with that behavior.
Additionally, teach parseLiteralBinding to treat constant
UnaryMinusExpressions as NumberLiteral bindings.

Change-Id: Iad221e90eb1de81cabdddf5d601cc30f53ef20d3
Reviewed-by: Andrei Golubev &lt;andrei.golubev@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While it is generally possible to assign a numeric to a value of string
type, this is not the case for literal bindings: There, the engine's
QQmlTypeValidator notices the mismatch, and rejects the program.
Bring qmllint in line with that behavior.
Additionally, teach parseLiteralBinding to treat constant
UnaryMinusExpressions as NumberLiteral bindings.

Change-Id: Iad221e90eb1de81cabdddf5d601cc30f53ef20d3
Reviewed-by: Andrei Golubev &lt;andrei.golubev@qt.io&gt;
</pre>
</div>
</content>
</entry>
</feed>
