aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-02-10 21:06:21 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-17 08:49:07 +0100
commit2fae4c35fde33d0212c8ff51cff9902dead664dd (patch)
tree74c734f8863719a35ce1df8ffa2a3af2983c611b /src
parentf3776e34c6dc0f85210396e986a1af9b7ab1218d (diff)
[new compiler] Compile time check for objects assigned to script strings
Change-Id: I873bded73a0d2210910c496312fb3b7b04e4a65f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/compiler/qqmltypecompiler.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp
index ce755d1c24..bb9f7fe18b 100644
--- a/src/qml/compiler/qqmltypecompiler.cpp
+++ b/src/qml/compiler/qqmltypecompiler.cpp
@@ -1908,6 +1908,9 @@ bool QQmlPropertyValidator::validateObjectBinding(QQmlPropertyData *property, co
} else if (QQmlValueTypeFactory::isValueType(property->propType)) {
recordError(binding->location, tr("Unexpected object assignment"));
return false;
+ } else if (property->propType == qMetaTypeId<QQmlScriptString>()) {
+ recordError(binding->valueLocation, tr("Invalid property assignment: script expected"));
+ return false;
} else {
// We want to raw metaObject here as the raw metaobject is the
// actual property type before we applied any extensions that might