From ed59dfeb706242d314aa21889ad0f5a7e028069f Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 26 Jan 2021 11:14:13 +0100 Subject: qmllint: Complain if member access check fails for namespaced types Before, we would prepend the namespace to the name, but then continue right away, never checking the new name. Change-Id: If90db7d33536fb4b549321c2d6b677040605b6f0 Reviewed-by: Fabian Kosmale --- tests/auto/qml/qmllint/data/brokenNamespace.qml | 5 +++++ tests/auto/qml/qmllint/tst_qmllint.cpp | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 tests/auto/qml/qmllint/data/brokenNamespace.qml (limited to 'tests/auto/qml') diff --git a/tests/auto/qml/qmllint/data/brokenNamespace.qml b/tests/auto/qml/qmllint/data/brokenNamespace.qml new file mode 100644 index 0000000000..45f20b941c --- /dev/null +++ b/tests/auto/qml/qmllint/data/brokenNamespace.qml @@ -0,0 +1,5 @@ +import QtQuick as T + +T.Item { + objectName: T.some.bs +} diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index c1ccae7235..994bb2cea0 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -273,6 +273,10 @@ void TestQmllint::dirtyQmlCode_data() << QStringLiteral("badScript.qml") << QString("Warning: Property \"stuff\" not found on type \"Empty\"") << QString(); + QTest::newRow("brokenNamespace") + << QStringLiteral("brokenNamespace.qml") + << QString("Warning: type not found in namespace at %1:4:17") + << QString(); } void TestQmllint::dirtyQmlCode() -- cgit v1.2.3