]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error when trying to pass signal as argument
authorJürg Billeter <j@bitron.ch>
Tue, 15 Sep 2009 08:45:47 +0000 (10:45 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 15 Sep 2009 08:45:47 +0000 (10:45 +0200)
Fixes bug 584350.

vala/valasemanticanalyzer.vala

index ff54fbcd14c3321d73845b7a0f2c3839a93e6c6f..1527d02d1478453251d2a434762f057ce4f1b23f 100644 (file)
@@ -408,6 +408,10 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                                        // ignore inner error
                                        expr.error = true;
                                        return false;
+                               } else if (arg.value_type is SignalType) {
+                                       arg.error = true;
+                                       Report.error (arg.source_reference, "Cannot pass signals as arguments");
+                                       return false;
                                } else if (arg.value_type == null) {
                                        // disallow untyped arguments except for type inference of callbacks
                                        if (!(arg.symbol_reference is Method)) {