[vala] Report error when declaring signals with static modifier



commit 42f1312567b2a3ca69e45162f981e730d809aa2a
Author: Jürg Billeter <j bitron ch>
Date:   Mon Sep 14 17:46:57 2009 +0200

    Report error when declaring signals with static modifier
    
    Fixes bug 594440.

 vala/valaparser.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 6a1ebaf..7725343 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -2427,6 +2427,11 @@ public class Vala.Parser : CodeVisitor {
 		var sig = new Signal (id, type, get_src (begin), comment);
 		sig.access = access;
 		set_attributes (sig, attrs);
+		if (ModifierFlags.STATIC in flags) {
+			throw new ParseError.SYNTAX (get_error ("`static' modifier not allowed on signals"));
+		} else if (ModifierFlags.CLASS in flags) {
+			throw new ParseError.SYNTAX (get_error ("`class' modifier not allowed on signals"));
+		}
 		if (ModifierFlags.VIRTUAL in flags) {
 			sig.is_virtual = true;
 		}



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