From: Jürg Billeter Date: Fri, 10 Sep 2010 15:57:44 +0000 (+0200) Subject: Report error for private virtual methods X-Git-Tag: 0.11.0~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67ef701abf6cda66856ff39396cf1bf1913bcd51;p=thirdparty%2Fvala.git Report error for private virtual methods --- diff --git a/vala/valamethod.vala b/vala/valamethod.vala index bc6510e23..446a3f750 100644 --- a/vala/valamethod.vala +++ b/vala/valamethod.vala @@ -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) {