diff options
| author | Olivier De Cannière <olivier.decanniere@qt.io> | 2024-02-08 09:56:11 +0100 |
|---|---|---|
| committer | Olivier De Cannière <olivier.decanniere@qt.io> | 2024-02-08 10:17:33 +0100 |
| commit | 15b1aaadd2be9acb337b46ff789c1ad9e18436fb (patch) | |
| tree | aaf6bffb4c3c7182ad91edfd9658bb920a1d3a40 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 7a3dfcff281f91fe11eac1bc09e0049a5a72d334 (diff) | |
Compiler: Also check for shadowing on optional lookups
Amends: fc4ee77116624c784d8c42f2b8e5dbf2f78b6d89
Pick-to: 6.7
Change-Id: I3f5f2b74e4b89b82e7fb54072091143010bab8aa
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 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 1f7e7eeb1f..208ca15444 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -113,6 +113,7 @@ private slots: void getOptionalLookup(); void getOptionalLookup_data(); void getOptionalLookupOnQJSValueNonStrict(); + void getOptionalLookupShadowed(); void globals(); void idAccess(); void ignoredFunctionReturn(); @@ -2127,6 +2128,18 @@ void tst_QmlCppCodegen::getOptionalLookupOnQJSValueNonStrict() QVERIFY(o->property("b").toBool()); } +void tst_QmlCppCodegen::getOptionalLookupShadowed() +{ + QQmlEngine engine; + const QUrl document(u"qrc:/qt/qml/TestTypes/GetOptionalLookupShadowed.qml"_s); + QQmlComponent c(&engine, document); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + QScopedPointer<QObject> o(c.create()); + QVERIFY(o); + + QCOMPARE(o->property("res").toString(), "a"); +} + void tst_QmlCppCodegen::globals() { QQmlEngine engine; |
