From 2fae4c35fde33d0212c8ff51cff9902dead664dd Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 10 Feb 2014 21:06:21 +0100 Subject: [new compiler] Compile time check for objects assigned to script strings Change-Id: I873bded73a0d2210910c496312fb3b7b04e4a65f Reviewed-by: Lars Knoll --- src/qml/compiler/qqmltypecompiler.cpp | 3 +++ 1 file changed, 3 insertions(+) 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()) { + 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 -- cgit v1.2.3