aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/consoleObject.qml
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2025-06-26 15:05:52 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2025-06-26 20:36:14 +0200
commit69fb18357c8495b58dba04960629f1f21eed3618 (patch)
treec3a0b2e6dca860e5978112edd487e266d9e84834 /tests/auto/qml/qmlcppcodegen/data/consoleObject.qml
parent7b44231f33959a40684aebefcf6473a5339ef445 (diff)
compiler: Avoid invalid C++ code generation
inlineConsoleMethod's stringConversion needs to create a string, so that we can later append to it. Because we were missing parentheses, this did not happen, and we would end up with code looking like u']'.append(...) which obviously isn't valid C++. Fix this by always adding parentheses around the expression. Found while trying to prove that QTBUG-109279 was fixed. Task-number: QTBUG-109279 Pick-to: 6.10 6.9 Change-Id: I67fce5b2c1f1460a5d6b617824f3c36f9804ea76 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data/consoleObject.qml')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/consoleObject.qml12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/consoleObject.qml b/tests/auto/qml/qmlcppcodegen/data/consoleObject.qml
index 9fa32bafee..0c8ee8f030 100644
--- a/tests/auto/qml/qmlcppcodegen/data/consoleObject.qml
+++ b/tests/auto/qml/qmlcppcodegen/data/consoleObject.qml
@@ -4,6 +4,16 @@ import QtQml
LoggingCategory {
id: self
name: "foobar"
+
+ // tests sequence handling
+ function xyz() {
+ const d = [1, 2, 3, 4, 5];
+ const contained = d.includes(3);
+ console.log(d, contained);
+ }
+
+
+
Component.onCompleted: {
console.debug("b", 4.55);
console.log("b", 4.55);
@@ -26,5 +36,7 @@ LoggingCategory {
console.log(4)
console.log(self);
console.log(Component);
+
+ self.xyz()
}
}