summaryrefslogtreecommitdiff
path: root/vala/valapropertyaccessor.vala
diff options
context:
space:
mode:
authorSimon Werbeck <simon.werbeck@gmail.com>2014-08-14 21:47:44 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2017-03-09 20:31:05 +0100
commit616f94536eddb2735360f38ff29e40e3dc277fd1 (patch)
tree69d8b36630c687f5cf074ddd6ebaa52f77a56f8d /vala/valapropertyaccessor.vala
parentdc456fcb24ab5c8e588629c68a467d8a1ac97a6f (diff)
downloadvala-616f94536eddb2735360f38ff29e40e3dc277fd1.tar.gz
vala: Disallow private accessors in overridable properties
https://bugzilla.gnome.org/show_bug.cgi?id=603491
Diffstat (limited to 'vala/valapropertyaccessor.vala')
-rw-r--r--vala/valapropertyaccessor.vala6
1 files changed, 6 insertions, 0 deletions
diff --git a/vala/valapropertyaccessor.vala b/vala/valapropertyaccessor.vala
index 90048486e..81981b84a 100644
--- a/vala/valapropertyaccessor.vala
+++ b/vala/valapropertyaccessor.vala
@@ -178,6 +178,12 @@ public class Vala.PropertyAccessor : Subroutine {
}
}
+ if ((prop.is_abstract || prop.is_virtual || prop.overrides) && access == SymbolAccessibility.PRIVATE) {
+ error = true;
+ Report.error (source_reference, "Property `%s' with private accessor cannot be marked as abstract, virtual or override".printf (prop.get_full_name ()));
+ return false;
+ }
+
if (body != null) {
if (writable || construction) {
body.scope.add (value_parameter.name, value_parameter);