diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2023-10-17 14:06:32 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-10-23 14:44:19 +0200 |
| commit | 22eaa614ea86c5f823e3de17efa1e43635b52ca7 (patch) | |
| tree | db00c82fb8a8d5b7ef9159ddcbeff7d8d31fc0dc /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | b7aba647b018bc67e5b42c19752c32a7ef0336d9 (diff) | |
QmlCompiler: Reject calls to one of multiple fuzzy overloads
If we cannot statically determine the right overload better don't call
any of them for now. Also, allow attempts to pass arguments as derived
types during type propagation.
The test shows that we don't properly pass the thisObject when calling
with metatypes. Fix that, too.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-117922
Change-Id: I02e70ffb9a05f3cfedccafde6e16170b0efbcd29
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
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 | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 3496ca25dd..486a777fef 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -3341,6 +3341,8 @@ void tst_QmlCppCodegen::overriddenProperty() QCOMPARE(child->objectName(), u"double"_s); QMetaObject::invokeMethod(child, "doArray"); QCOMPARE(child->objectName(), u"javaScript"_s); + QMetaObject::invokeMethod(child, "doFoo"); + QCOMPARE(child->objectName(), u"ObjectWithMethod"_s); ObjectWithMethod *benign = new ObjectWithMethod(object.data()); benign->theThing = 10; |
