aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsimportvisitor_p.h
diff options
context:
space:
mode:
authorFabian Kosmale <[email protected]>2021-12-13 17:12:03 +0100
committerFabian Kosmale <[email protected]>2021-12-16 21:03:31 +0100
commit096a1c4f6ed6abb259a0f1eb377895090e69cc4c (patch)
tree580ea4b5ffc99ddbb823b405a393ecb4bdbeaa84 /src/qmlcompiler/qqmljsimportvisitor_p.h
parent699c02233a48384278248aa6a13875c6fcdfa6f2 (diff)
Warn about duplicated ids
Besides emitting a warning in case of duplicated ids, this commit also refactors the id handling by moving it out of the generic visit function, into a dedicated method. Moreover, internal documentation is added to various functions in QQmlJSScopesById, and a new function to quickly check for duplicated ids in a file is added. While those conflicts do not necessiate an id duplication (they could be in different components), this allows for a quick pre-check, and might be later used to print a non-fatal warning about the potentially confusing id reuse. Fixes: QTBUG-99179 Change-Id: Ia99ebd17491d91d6f7747d65b3a8d15fa1f84e07 Reviewed-by: Ulf Hermann <[email protected]>
Diffstat (limited to 'src/qmlcompiler/qqmljsimportvisitor_p.h')
-rw-r--r--src/qmlcompiler/qqmljsimportvisitor_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljsimportvisitor_p.h b/src/qmlcompiler/qqmljsimportvisitor_p.h
index 065746b53a..c5175fac2a 100644
--- a/src/qmlcompiler/qqmljsimportvisitor_p.h
+++ b/src/qmlcompiler/qqmljsimportvisitor_p.h
@@ -265,6 +265,7 @@ protected:
private:
void importBaseModules();
void resolveAliasesAndIds();
+ void handleIdDeclaration(QQmlJS::AST::UiScriptBinding *scriptBinding);
void visitFunctionExpressionHelper(QQmlJS::AST::FunctionExpression *fexpr);
void processImportWarnings(