diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2022-10-12 11:28:30 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-10-12 20:43:34 +0200 |
| commit | 1a0c4094e0fce8693a4653a9b3cb80f832865495 (patch) | |
| tree | 79a0cd20c490c938fc8f7f429a8d16f72b9d5884 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 29b3cbb983d864b21119dbcb58129db2c93c99c3 (diff) | |
QmlCompiler: Properly check contained type for enums
In case of an enum the actual contained type is the one the enum
dictates. This brings registerContains() in line with containedType()
and makes it possible to match previously discovered types on subsequent
passes of the type propagator. Therefore, it avoids infinite loops where
the same types would be tracked over and over.
Pick-to: 6.4
Fixes: QTBUG-107176
Fixes: QTBUG-107542
Change-Id: I4b8d66b157d0ec0ece4ca345cb99a630b8898a1b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 19acf4fc78..23939e73fb 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -139,6 +139,7 @@ private slots: void notNotString(); void mathOperations(); void inaccessibleProperty(); + void typePropagationLoop(); }; void tst_QmlCppCodegen::initTestCase() @@ -2725,6 +2726,17 @@ void tst_QmlCppCodegen::inaccessibleProperty() QCOMPARE(o->property("c").toInt(), 5); } +void tst_QmlCppCodegen::typePropagationLoop() +{ + QQmlEngine engine; + + QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/typePropagationLoop.qml"_s)); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + QScopedPointer<QObject> o(c.create()); + + QCOMPARE(o->property("j").toInt(), 3); +} + QTEST_MAIN(tst_QmlCppCodegen) #include "tst_qmlcppcodegen.moc" |
