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()); } }