Fix error message for group property definitions on signals in new compiler
authorSimon Hausmann <simon.hausmann@digia.com>
Mon, 30 Sep 2013 06:46:45 +0000 (08:46 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 30 Sep 2013 16:21:53 +0000 (18:21 +0200)
It may happen that people forget the colon after the handler name in

    onSomeSignal { code here }

and we have to print out the correct error message. It looks like a
group property, but we can identify this binding due to its reserved
use of starting with "on".

Change-Id: I7c502c1a2a5f2a6c613879468a60bc57a7d20fe8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/compiler/qqmlcodegenerator.cpp

index 84bab99..b257d2d 100644 (file)
@@ -1221,12 +1221,13 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio
             continue;
         }
 
-        if (binding->type != QV4::CompiledData::Binding::Type_Script)
-            continue;
-
         if (!QQmlCodeGenerator::isSignalPropertyName(propertyName))
             continue;
 
+        if (binding->type != QV4::CompiledData::Binding::Type_Script) {
+            COMPILE_EXCEPTION(binding->location, tr("Incorrectly specified signal assignment"));
+        }
+
         PropertyResolver resolver(propertyCache);
 
         Q_ASSERT(propertyName.startsWith(QStringLiteral("on")));