summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcompiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/qmlcompiler.cpp')
-rw-r--r--src/declarative/qml/qmlcompiler.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 070add7..c0f7bfd 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -1452,10 +1452,13 @@ bool QmlCompiler::buildIdProperty(QmlParser::Property *prop,
if (!isValidId(val))
COMPILE_EXCEPTION(prop, val << "is not a valid object id");
- // We disallow id's that conflict with import prefixes
+ // We disallow id's that conflict with import prefixes and types
QmlEnginePrivate::ImportedNamespace *ns = 0;
+ QmlType *type = 0;
QmlEnginePrivate::get(engine)->resolveType(unit->imports, val.toUtf8(),
- 0, 0, 0, 0, &ns);
+ &type, 0, 0, 0, &ns);
+ if (type)
+ COMPILE_EXCEPTION(idValue, "id conflicts with type name");
if (ns)
COMPILE_EXCEPTION(idValue, "id conflicts with namespace prefix");