[vala/0.10-parallel: 45/46] Report error for private virtual methods
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.10-parallel: 45/46] Report error for private virtual methods
- Date: Fri, 10 Sep 2010 16:17:40 +0000 (UTC)
commit d3ea0c2d730130ffb36717562a87960bdb1dcb0d
Author: Jürg Billeter <j bitron ch>
Date: Fri Sep 10 17:57:44 2010 +0200
Report error for private virtual methods
vala/valamethod.vala | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index a29ab05..1f47591 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -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) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]