aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint/checkidentifiers.cpp
diff options
context:
space:
mode:
authorEvgeniy A. Dushistov <dushistov@mail.ru>2020-06-17 23:39:28 +0300
committerEvgeniy A. Dushistov <dushistov@mail.ru>2020-06-18 11:21:18 +0300
commitb916c1bffdd4bcaaa6d4d75d2a9efa34a485cff5 (patch)
treede9498b87eb4bdb2156507b126079f627819fc45 /tools/qmllint/checkidentifiers.cpp
parente8d9bc1bcada7d94af5a33d64a9afc860ede5b84 (diff)
qmllint: high level item can also be list
Fixes: QTBUG-84300 Change-Id: I1a9db060cdeb7c4ec10deedab5141a06245a55b2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools/qmllint/checkidentifiers.cpp')
-rw-r--r--tools/qmllint/checkidentifiers.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/qmllint/checkidentifiers.cpp b/tools/qmllint/checkidentifiers.cpp
index e1593182ab..32eb4ce025 100644
--- a/tools/qmllint/checkidentifiers.cpp
+++ b/tools/qmllint/checkidentifiers.cpp
@@ -83,12 +83,19 @@ void CheckIdentifiers::printContext(const QQmlJS::SourceLocation &location) cons
}
bool CheckIdentifiers::checkMemberAccess(const QVector<ScopeTree::FieldMember> &members,
- const ScopeTree::ConstPtr &outerScope) const
+ const ScopeTree::ConstPtr &outerScope,
+ const MetaProperty *prop) const
{
+
QStringList expectedNext;
QString detectedRestrictiveName;
QString detectedRestrictiveKind;
+ if (prop != nullptr && prop->isList()) {
+ detectedRestrictiveKind = QLatin1String("list");
+ expectedNext.append(QLatin1String("length"));
+ }
+
ScopeTree::ConstPtr scope = outerScope;
for (const ScopeTree::FieldMember &access : members) {
if (scope.isNull()) {
@@ -319,7 +326,7 @@ bool CheckIdentifiers::operator()(const QHash<QString, ScopeTree::ConstPtr> &qml
.arg(memberAccessBase.m_location.startColumn), Normal);
printContext(memberAccessBase.m_location);
noUnqualifiedIdentifier = false;
- } else if (!checkMemberAccess(memberAccessChain, qmlIt->type())) {
+ } else if (!checkMemberAccess(memberAccessChain, qmlIt->type(), &*qmlIt)) {
noUnqualifiedIdentifier = false;
}