]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Do not allow abstract, virtual and override at the same time for properties
authorLuca Bruno <lucabru@src.gnome.org>
Fri, 21 Jun 2013 18:43:56 +0000 (20:43 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Fri, 21 Jun 2013 21:37:59 +0000 (23:37 +0200)
Fixes bug 702736

vala/valaparser.vala

index 9ee008bf9f0550481021b8b2b33c40791c9e762b..a7ca9c0fd90449ee33afd88e219c48847160856c 100644 (file)
@@ -2685,6 +2685,12 @@ public class Vala.Parser : CodeVisitor {
                if (ModifierFlags.EXTERN in flags || scanner.source_file.file_type == SourceFileType.PACKAGE) {
                        prop.external = true;
                }
+               if ((prop.is_abstract && prop.is_virtual)
+                       || (prop.is_abstract && prop.overrides)
+                       || (prop.is_virtual && prop.overrides)) {
+                       throw new ParseError.SYNTAX (get_error ("only one of `abstract', `virtual', or `override' may be specified"));
+               }
+
                if (accept (TokenType.THROWS)) {
                        do {
                                prop.add_error_type (parse_type (true, false));