aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-11-10 14:50:18 +0100
committerUlf Hermann <ulf.hermann@qt.io>2022-11-11 12:07:42 +0100
commit259aec7cb4c031e14771d8eabbdea7866f03d698 (patch)
treedbc1262ac958b784ed8dff00a2ce2e762713ba8f /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parent17318c4805d089f10c25f8165dae7d1f908bd311 (diff)
QmlCompiler: Ignore InitializeDeadTemporalZone instruction
We don't discern between empty and undefined values in the compiler. Fixes: QTBUG-104192 Change-Id: Ida06386433ef9e8f9a7cba4bec99ba8e77edc324 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> 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.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index c017ba140f..8bb88e624c 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -142,6 +142,7 @@ private slots:
void typePropagationLoop();
void signatureIgnored();
void listAsArgument();
+ void letAndConst();
};
void tst_QmlCppCodegen::initTestCase()
@@ -2766,6 +2767,16 @@ void tst_QmlCppCodegen::listAsArgument()
QCOMPARE(o->property("d").value<QObject *>()->objectName(), u"this one"_s);
}
+void tst_QmlCppCodegen::letAndConst()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/letAndConst.qml"_s));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(!o.isNull());
+ QCOMPARE(o->objectName(), u"ab"_s);
+}
+
QTEST_MAIN(tst_QmlCppCodegen)
#include "tst_qmlcppcodegen.moc"