Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.7
-
None
-
04eca6984 (dev), d13a6ea1f (dev), 5cf5d2926 (6.7), 1d4e86395 (6.7)
Description
Consider the following QML function
function foo() {
return 1 + 1
}
qmlcachegen in verbose mode prints
Warning: Main.qml:10:9: function without return type annotation returns double of double [compiler] return 1 + 1 ^^^^^^
First of all "returns double of double" reads very weird. Presumably this should be "returns double".
But even beyond that the warning could be improved, maybe even with a suggestion
Warning: Main.qml:9: function with return value but no return type annotation function foo(): double { ^^^^^^^^
Tested with 6.7 and current dev
Attachments
For Gerrit Dashboard: QTBUG-124220 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
555988,6 | qmlcachegen: Improve warnings for missing return type annotations | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
556186,5 | qv4codegen: Store the location of binary expressions | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
556696,2 | qv4codegen: Store the location of binary expressions | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
556928,2 | qmlcachegen: Improve warnings for missing return type annotations | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |