aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data
diff options
context:
space:
mode:
authorOlivier De Cannière <olivier.decanniere@qt.io>2024-02-08 09:56:11 +0100
committerOlivier De Cannière <olivier.decanniere@qt.io>2024-02-08 10:17:33 +0100
commit15b1aaadd2be9acb337b46ff789c1ad9e18436fb (patch)
treeaaf6bffb4c3c7182ad91edfd9658bb920a1d3a40 /tests/auto/qml/qmlcppcodegen/data
parent7a3dfcff281f91fe11eac1bc09e0049a5a72d334 (diff)
Compiler: Also check for shadowing on optional lookups
Amends: fc4ee77116624c784d8c42f2b8e5dbf2f78b6d89 Pick-to: 6.7 Change-Id: I3f5f2b74e4b89b82e7fb54072091143010bab8aa Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt1
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/GetOptionalLookupShadowed.qml19
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt
index 7263766b5d..0cd324120a 100644
--- a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt
+++ b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt
@@ -49,6 +49,7 @@ set(qml_files
Enums.qml
Foozle.qml
GetOptionalLookupOnQJSValueNonStrict.qml
+ GetOptionalLookupShadowed.qml
Loopy.qml
OkType.qml
Panel.qml
diff --git a/tests/auto/qml/qmlcppcodegen/data/GetOptionalLookupShadowed.qml b/tests/auto/qml/qmlcppcodegen/data/GetOptionalLookupShadowed.qml
new file mode 100644
index 0000000000..eacefc3017
--- /dev/null
+++ b/tests/auto/qml/qmlcppcodegen/data/GetOptionalLookupShadowed.qml
@@ -0,0 +1,19 @@
+pragma Strict
+
+import QtQml
+import QtQuick
+
+QtObject {
+ id: root
+
+ component Base : QtObject {
+ property int i: 1
+ }
+
+ component Derived : Base {
+ property string i: "a"
+ }
+
+ property Base base: Derived { }
+ property var res: root.base?.i
+}