aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint/checkidentifiers.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-09-30 15:31:43 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-10-02 15:33:23 +0200
commitb2e1183cb7f4f552bb4409172f82327111f754bb (patch)
treef72311abf4c27dc6dd73acb005f5ceabb074d610 /tools/qmllint/checkidentifiers.cpp
parent65b6365ffbde369894f7af1ed735ea34a584d357 (diff)
qmllint: Remove member access chains from ScopeTree
What we need there is a proper type inference. This should be added separately. For now, keep the member access chains local in qmllint and don't pollute ScopeTree with them. Change-Id: I9f50aa4e54b285bd93e7bd4cd17797509df0c168 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmllint/checkidentifiers.cpp')
-rw-r--r--tools/qmllint/checkidentifiers.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/qmllint/checkidentifiers.cpp b/tools/qmllint/checkidentifiers.cpp
index 6366cc72ca..c47a3beb36 100644
--- a/tools/qmllint/checkidentifiers.cpp
+++ b/tools/qmllint/checkidentifiers.cpp
@@ -107,7 +107,7 @@ static bool walkViaParentAndAttachedScopes(ScopeTree::ConstPtr rootType,
return false;
}
-bool CheckIdentifiers::checkMemberAccess(const QVector<ScopeTree::FieldMember> &members,
+bool CheckIdentifiers::checkMemberAccess(const QVector<FieldMember> &members,
const ScopeTree::ConstPtr &outerScope,
const MetaProperty *prop) const
{
@@ -122,7 +122,7 @@ bool CheckIdentifiers::checkMemberAccess(const QVector<ScopeTree::FieldMember> &
}
ScopeTree::ConstPtr scope = outerScope;
- for (const ScopeTree::FieldMember &access : members) {
+ for (const FieldMember &access : members) {
if (scope.isNull()) {
writeWarning(m_colorOut);
m_colorOut->write(
@@ -289,6 +289,7 @@ bool CheckIdentifiers::checkMemberAccess(const QVector<ScopeTree::FieldMember> &
bool CheckIdentifiers::operator()(
const QHash<QString, ScopeTree::ConstPtr> &qmlIDs,
const QHash<QQmlJS::SourceLocation, SignalHandler> &signalHandlers,
+ const MemberAccessChains &memberAccessChains,
const ScopeTree::ConstPtr &root, const QString &rootId) const
{
bool noUnqualifiedIdentifier = true;
@@ -299,8 +300,8 @@ bool CheckIdentifiers::operator()(
while (!workQueue.empty()) {
const ScopeTree::ConstPtr currentScope = workQueue.dequeue();
- const auto memberAccessChains = currentScope->memberAccessChains();
- for (auto memberAccessChain : memberAccessChains) {
+ const auto scopeMemberAccessChains = memberAccessChains[currentScope];
+ for (auto memberAccessChain : scopeMemberAccessChains) {
if (memberAccessChain.isEmpty())
continue;