]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error when declaring signals with static modifier
authorJürg Billeter <j@bitron.ch>
Mon, 14 Sep 2009 15:46:57 +0000 (17:46 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 14 Sep 2009 15:46:57 +0000 (17:46 +0200)
Fixes bug 594440.

vala/valaparser.vala

index 6a1ebaf45a7d9503db817c6e90fbac0adf41a6c6..772534397c9c09635db1cab75df522982977c686 100644 (file)
@@ -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;
                }