summaryrefslogtreecommitdiff
path: root/vala/valapropertyaccessor.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2018-04-16 13:09:42 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2018-04-19 17:41:10 +0200
commit6780a0f00c9acefd5dab9b8ef4e7825a0b94f1b6 (patch)
tree354059219de01ca7ff21d132b10cfee75d564605 /vala/valapropertyaccessor.vala
parentd2d2e183d307441dc22b8ec11b5a3f6a783573f1 (diff)
downloadvala-6780a0f00c9acefd5dab9b8ef4e7825a0b94f1b6.tar.gz
vala: Accessors of abstract properties cannot have bodies
https://bugzilla.gnome.org/show_bug.cgi?id=795225
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 73d8c8239..46952bb19 100644
--- a/vala/valapropertyaccessor.vala
+++ b/vala/valapropertyaccessor.vala
@@ -184,6 +184,12 @@ public class Vala.PropertyAccessor : Subroutine {
return false;
}
+ if (body != null && prop.is_abstract) {
+ error = true;
+ Report.error (source_reference, "Accessor of abstract property `%s' cannot have body".printf (prop.get_full_name ()));
+ return false;
+ }
+
if (body != null) {
if (writable || construction) {
body.scope.add (value_parameter.name, value_parameter);