[QBS] Heads up: Stronger property type checking

Christian Kandeler christian.kandeler at qt.io
Fri Oct 7 10:59:43 CEST 2016


Hello,

this email is intended to make you aware that qbs will take the declared
type of a property more seriously from 1.7 on. This means that a line
like this will now cause an error:
    property string stringProp: true  // Type mismatch: true is not a string
More importantly, the same goes for assignments made to properties
declared elsewhere:
    cpp.cxxFlags: [[]] // Type mismatch: empty array is not a string
In practice, such mistakes are usually more subtle, as anyone who's ever
had a stray "-l" on a linker command line or was puzzled by a
"-Dundefined" on their compiler call can corroborate.
If you have a project that took advantage of automatic conversions in
property assignments, you should fix it now.
For details, see the relevant patch at
https://codereview.qt-project.org/#/c/169577/.
Imperative JavaScript code that is not assigned to a property will keep
doing the usual conversions defined by the language.


Regards,
Christian



More information about the Qbs mailing list