From: Luca Bruno Date: Fri, 21 Jun 2013 18:43:56 +0000 (+0200) Subject: Do not allow abstract, virtual and override at the same time for properties X-Git-Tag: 0.21.1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6747b2f732b1a89f83dba500a10c701cf272b3e0;p=thirdparty%2Fvala.git Do not allow abstract, virtual and override at the same time for properties Fixes bug 702736 --- diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 9ee008bf9..a7ca9c0fd 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -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));