[vala] Report error when trying to pass signal as argument



commit 34a4aa68931ae8881492840c495532ae831f90cd
Author: Jürg Billeter <j bitron ch>
Date:   Tue Sep 15 10:45:47 2009 +0200

    Report error when trying to pass signal as argument
    
    Fixes bug 584350.

 vala/valasemanticanalyzer.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala
index ff54fbc..1527d02 100644
--- a/vala/valasemanticanalyzer.vala
+++ b/vala/valasemanticanalyzer.vala
@@ -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)) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]