Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.7.3, 6.7, 6.8.0 Beta2, 6.8, 6.9.0 FF
-
6.7.0
-
None
-
ae76c8f42 (dev), 2889e7963 (6.8), 342fbebd3 (6.7)
Description
Please try the attached example. All functions should return the string "A+B".
However, the compiled version does not:
qml: foo1: qml: foo2: A+B qml: foo3: A+B
import QtQuick Window { width: 640 height: 480 visible: true title: qsTr("Hello World") // compiled: fail function foo1() : string { var s = []; s.push("A") s.push("B") return s.join("+"); } // not compiled: "toString" seems to disable the compiler function foo2() : string { var s = []; s.push("A") s.push("B") return s.join("+").toString(); } // not compiled: no return type annotation function foo3() { var s = []; s.push("A") s.push("B") return s.join("+"); } Component.onCompleted: { console.log("foo1:", foo1()); console.log("foo2:", foo2()); console.log("foo3:", foo3()); } }
Attachments
For Gerrit Dashboard: QTBUG-126834 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
573771,2 | QmlCompiler: Fix side effect detection for array methods | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
573972,2 | QmlCompiler: Fix side effect detection for array methods | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
574112,2 | QmlCompiler: Fix side effect detection for array methods | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |