aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-03-18 11:44:13 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-03-18 12:37:04 +0100
commit13caf26b29283b544edc2974fa1ea0481c63b435 (patch)
treec06077293de36f69c42b5e1a38844e2b8bbe07c4 /src/qml/compiler
parent36fb7cf832e801a7b3718fa443ec2f1b83e0fea2 (diff)
parent869efe4a49c5286493d7f039325992725bcac6c3 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: tools/qmllint/findunqualified.cpp Change-Id: I2593b5cc0db1d14e0c944aec4b88a80f46f5b0c1
Diffstat (limited to 'src/qml/compiler')
-rw-r--r--src/qml/compiler/qqmlirbuilder.cpp6
-rw-r--r--src/qml/compiler/qqmlirbuilder_p.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp
index 0316e54c09..1f2e59b55e 100644
--- a/src/qml/compiler/qqmlirbuilder.cpp
+++ b/src/qml/compiler/qqmlirbuilder.cpp
@@ -549,6 +549,12 @@ bool IRBuilder::visit(QQmlJS::AST::UiInlineComponent *ast)
recordError(ast->firstSourceLocation(), QLatin1String("Nested inline components are not supported"));
return false;
}
+ if (inlineComponentsNames.contains(ast->name.toString())) {
+ recordError(ast->firstSourceLocation(), QLatin1String("Inline component names must be unique per file"));
+ return false;
+ } else {
+ inlineComponentsNames.insert(ast->name.toString());
+ }
{
QScopedValueRollback<bool> rollBack {insideInlineComponent, true};
if (!defineQMLObject(&idx, ast->component))
diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h
index 1f2c11f7f3..254d21001b 100644
--- a/src/qml/compiler/qqmlirbuilder_p.h
+++ b/src/qml/compiler/qqmlirbuilder_p.h
@@ -543,6 +543,7 @@ public:
QList<QQmlJS::DiagnosticMessage> errors;
QSet<QString> illegalNames;
+ QSet<QString> inlineComponentsNames;
QList<const QV4::CompiledData::Import *> _imports;
QList<Pragma*> _pragmas;