aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-10-28 14:00:33 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-11-08 09:11:34 +0100
commit1baa623122702bfd11affce622993747a9fe941f (patch)
tree22a38197bbc2fba8a00f1812da6c38afbb997745 /tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
parent8140078364e1e441437abfda11699473abc9034e (diff)
Do not resolve containing types of inline components too early
At that point the type doesn't exist yet, because we are just parsing it. By trying to resolve it, we may find other, unrelated, types. Fixes: QTBUG-96796 Change-Id: I0a3137122a6dc969b76bbf4efcfb07b6341fecf2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 963623609d43a6f4087443f6992be14d2bc0900d)
Diffstat (limited to 'tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp')
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 31bf30c57c..bffb62c59e 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -337,6 +337,8 @@ private slots:
void hangOnWarning();
+ void ambiguousContainingType();
+
private:
QQmlEngine engine;
QStringList defaultImportPathList;
@@ -5860,6 +5862,20 @@ void tst_qqmllanguage::hangOnWarning()
QVERIFY(object != nullptr);
}
+void tst_qqmllanguage::ambiguousContainingType()
+{
+ // Need to do it twice, so that we load from disk cache the second time.
+ for (int i = 0; i < 2; ++i) {
+ QQmlEngine engine;
+
+ // Should not crash when loading the type
+ QQmlComponent c(&engine, testFileUrl("ambiguousBinding/ambiguousContainingType.qml"));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(!o.isNull());
+ }
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"