[new compiler] Improve error message for incorrect signal assignments
authorSimon Hausmann <simon.hausmann@digia.com>
Wed, 19 Feb 2014 15:03:03 +0000 (16:03 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sun, 2 Mar 2014 13:47:42 +0000 (14:47 +0100)
Change-Id: I16e7cdc6b5b49200259ea7e57d84e00f095554f4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/compiler/qqmlcodegenerator.cpp

index aaf93bf..9f94118 100644 (file)
@@ -1921,7 +1921,11 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio
         }
 
         if (binding->type != QV4::CompiledData::Binding::Type_Script) {
-            COMPILE_EXCEPTION(binding->location, tr("Incorrectly specified signal assignment"));
+            if (binding->type < QV4::CompiledData::Binding::Type_Script) {
+                COMPILE_EXCEPTION(binding->location, tr("Cannot assign a value to a signal (expecting a script to be run)"));
+            } else {
+                COMPILE_EXCEPTION(binding->location, tr("Incorrectly specified signal assignment"));
+            }
         }
 
         QQmlJS::Engine &jsEngine = parsedQML->jsParserEngine;