]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error for private virtual methods
authorJürg Billeter <j@bitron.ch>
Fri, 10 Sep 2010 15:57:44 +0000 (17:57 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 10 Sep 2010 15:57:44 +0000 (17:57 +0200)
vala/valamethod.vala

index bc6510e2339b9609c540b5cac4911406704dc6f1..446a3f750077bc142a4b9b92965ad3bf541e6cab 100644 (file)
@@ -914,11 +914,16 @@ public class Vala.Method : Symbol {
 
                if (analyzer.current_struct != null) {
                        if (is_abstract || is_virtual || overrides) {
+                               error = true;
                                Report.error (source_reference, "A struct member `%s' cannot be marked as override, virtual, or abstract".printf (get_full_name ()));
                                return false;
                        }
                } else if (overrides && base_method == null) {
                        Report.error (source_reference, "%s: no suitable method found to override".printf (get_full_name ()));
+               } else if ((is_abstract || is_virtual || overrides) && access == SymbolAccessibility.PRIVATE) {
+                       error = true;
+                       Report.error (source_reference, "Private member `%s' cannot be marked as override, virtual, or abstract".printf (get_full_name ()));
+                       return false;
                }
 
                if (!external_package && !overrides && !hides && get_hidden_member () != null) {