aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/imports
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-04-01 14:21:02 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-04-01 23:16:45 +0000
commitfdd848c225053d90a59f8a9fbe072b83162b87ed (patch)
treebed5a4a57518413b0a5380d7bc9256064c386840 /tests/auto/qml/qmlcppcodegen/data/imports
parent1d6d926b72847e8c92a0f83dc4b09982e652ea8f (diff)
QmlCompiler: Improve ambiguous type detection
When detecting an ambiguous type, we need to invalidate the entry in the list of types, rather than delete it. If we delete it and we get yet another version of the type, we'll add that one just like it was not ambiguous. Furthermore, we cannot check the type name when looking for ambiguity. The QML name can be bent and twisted in various ways, to import ambiguous-looking types under different names, so that they are actually not ambiguous. Fixes: QTBUG-102153 Change-Id: Iee7951229c5f68b168899e55164e8cf91587eec1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c12f0f07f577d4a2c58fd139d0ca0b7aac39fda9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data/imports')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/imports/Ambiguous/Thing3.qml5
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/imports/Ambiguous/qmldir3
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/imports/Ambiguous/Thing3.qml b/tests/auto/qml/qmlcppcodegen/data/imports/Ambiguous/Thing3.qml
new file mode 100644
index 0000000000..d5e428f042
--- /dev/null
+++ b/tests/auto/qml/qmlcppcodegen/data/imports/Ambiguous/Thing3.qml
@@ -0,0 +1,5 @@
+import QtQml
+
+QtObject {
+ property int a: 15
+}
diff --git a/tests/auto/qml/qmlcppcodegen/data/imports/Ambiguous/qmldir b/tests/auto/qml/qmlcppcodegen/data/imports/Ambiguous/qmldir
index 77c86ce27d..1c9b9a9e15 100644
--- a/tests/auto/qml/qmlcppcodegen/data/imports/Ambiguous/qmldir
+++ b/tests/auto/qml/qmlcppcodegen/data/imports/Ambiguous/qmldir
@@ -2,4 +2,7 @@ module Ambiguous
Thing 1.0 Thing1.qml
Thing 1.0 Thing2.qml
+Thing 1.0 Thing3.qml
+Thing2 1.0 Thing1.qml
+Thing2 1.0 Thing2.qml
NotHere 1.12 Here.qml