aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/mergeSideEffects.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data/mergeSideEffects.qml')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/mergeSideEffects.qml20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/mergeSideEffects.qml b/tests/auto/qml/qmlcppcodegen/data/mergeSideEffects.qml
new file mode 100644
index 0000000000..d4a8fec42e
--- /dev/null
+++ b/tests/auto/qml/qmlcppcodegen/data/mergeSideEffects.qml
@@ -0,0 +1,20 @@
+import QtQml
+
+QtObject {
+ property bool no: false
+ property list<int> a: [1]
+ property list<int> b: [2]
+
+ property int c: {
+ let numbers = a;
+ a = [3]; // create side effect affecting "numbers"
+
+ if (no) {
+ // Force two branches to be merged on "numbers"
+ numbers = b
+ }
+
+ // Side effect is still in effect
+ return numbers[0];
+ }
+}