qmllint: Fix false unknown grouped property warning

We seem to be checking grouped properties twice by endVisit(UiObjectBinding*) and endVisit(UiObjectDefinition*).
So the UiObjectBinding variant is removed here as this gets run before all type information is available.

Change-Id: Idfe23869792f787df6109cde3b6bc1d96cce3dc3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Maximilian Goldstein 2021-02-12 11:32:53 +01:00
parent 25f765cbd9
commit 4660f51f25
4 changed files with 8 additions and 9 deletions

View File

@ -0,0 +1,7 @@
import QtQuick 2.0
Rectangle {
border.width: 1
gradient: Gradient {}
}

View File

@ -360,6 +360,7 @@ void TestQmllint::cleanQmlCode_data()
QTest::newRow("overridescript") << QStringLiteral("overridescript.qml");
QTest::newRow("multiExtension") << QStringLiteral("multiExtension.qml");
QTest::newRow("segFault") << QStringLiteral("SegFault.qml");
QTest::newRow("grouped scope failure") << QStringLiteral("groupedScope.qml");
}
void TestQmllint::cleanQmlCode()

View File

@ -404,14 +404,6 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiObjectBinding *uiob)
return true;
}
void FindWarningVisitor::endVisit(QQmlJS::AST::UiObjectBinding *uiob)
{
QQmlJSImportVisitor::endVisit(uiob);
if (m_warnUnqualified)
checkGroupedScopes(m_currentScope);
}
bool FindWarningVisitor::visit(QQmlJS::AST::UiObjectDefinition *uiod)
{
using namespace QQmlJS::AST;

View File

@ -109,7 +109,6 @@ private:
/* --- end block handling --- */
bool visit(QQmlJS::AST::UiObjectBinding *uiob) override;
void endVisit(QQmlJS::AST::UiObjectBinding *uiob) override;
bool visit(QQmlJS::AST::UiObjectDefinition *uiod) override;
void endVisit(QQmlJS::AST::UiObjectDefinition *) override;
bool visit(QQmlJS::AST::UiScriptBinding *uisb) override;