[vala/0.10-parallel: 31/32] 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: 31/32] Report error for private virtual methods
- Date: Fri, 17 Sep 2010 23:03:36 +0000 (UTC)
commit 5a55c8f1ac59fdb828c0fb9d6e230990ceec7c94
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]