[vala] Do not allow abstract, virtual and override at the same time for properties



commit 6747b2f732b1a89f83dba500a10c701cf272b3e0
Author: Luca Bruno <lucabru src gnome org>
Date:   Fri Jun 21 20:43:56 2013 +0200

    Do not allow abstract, virtual and override at the same time for properties
    
    Fixes bug 702736

 vala/valaparser.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 9ee008b..a7ca9c0 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));


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