]> 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, 17 Sep 2010 23:00:15 +0000 (01:00 +0200)
vala/valamethod.vala

index a29ab05921485bb3a295a97012a6cf15af1fa24e..1f475912f4cf896ab974978fd81a1fb1df3e214b 100644 (file)
@@ -912,11 +912,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) {