diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-03-28 09:20:09 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2025-03-31 08:29:52 +0000 |
| commit | c36416c9713f9ac98529affadf07b05d8b6ae95e (patch) | |
| tree | 188f9b8dba853598c8ac77421a0f4b54998ad3bf /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | d9145dd37e57aad18d99fae1d20c571c1ead30e6 (diff) | |
QmlCompiler: Do not re-resolve iterator value types
We've resolved the value type in the type propagator. Trying to do it
again in the code generator, after the iterator may have been adjusted,
is quite wrong. If we resolve the list value type on a type that's not
a list (anymore), then we get an invalid type, which subsequently
crashes.
Amends commit a173d50a9e54d2a21a5207f6c66bb54bb8f3a612.
Pick-to: 6.9 6.8
Fixes: QTBUG-135288
Change-Id: I1227803ed100c83f8fc11898be0a4d0199d639dd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 9ac9898ed0..9dd3016809 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -157,6 +157,7 @@ private slots: void invisibleListElementType(); void invisibleSingleton(); void invisibleTypes(); + void iterateUnknownValue(); void iteration(); void javaScriptArgument(); void jsArrayMethods(); @@ -2925,6 +2926,20 @@ void tst_QmlCppCodegen::invisibleTypes() // QCOMPARE(meta->className(), "DerivedFromInvisible"); } +void tst_QmlCppCodegen::iterateUnknownValue() +{ + QQmlEngine engine; + QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/iterateUnknownValue.qml"_s)); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + + QTest::ignoreMessage(QtDebugMsg, "one"); + QTest::ignoreMessage(QtDebugMsg, "two"); + QTest::ignoreMessage(QtDebugMsg, "three"); + + QScopedPointer<QObject> o(c.create()); + QVERIFY(!o.isNull()); +} + void tst_QmlCppCodegen::iteration() { QQmlEngine engine; |
