diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmllint/checkidentifiers.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/qmllint/checkidentifiers.cpp b/tools/qmllint/checkidentifiers.cpp index a22727492d..2c87023701 100644 --- a/tools/qmllint/checkidentifiers.cpp +++ b/tools/qmllint/checkidentifiers.cpp @@ -31,6 +31,7 @@ #include <QtQmlCompiler/private/qcoloroutput_p.h> #include <QtCore/qqueue.h> +#include <QtCore/private/qduplicatetracker_p.h> #include <QtCore/qsharedpointer.h> #include <stack> @@ -46,12 +47,17 @@ static bool walkRelatedScopes(QQmlJSScope::ConstPtr rootType, const Visitor &vis if (rootType.isNull()) return false; std::stack<QQmlJSScope::ConstPtr> stack; + QDuplicateTracker<QQmlJSScope::ConstPtr> seenTypes; stack.push(rootType); while (!stack.empty()) { const auto type = stack.top(); stack.pop(); + // If we've seen this type before (can be caused by self attaching types), ignore it + if (seenTypes.hasSeen(type)) + continue; + if (visit(type)) return true; |