summaryrefslogtreecommitdiff
path: root/vala/valaproperty.vala
diff options
context:
space:
mode:
authorAlistair Thomas <astavale@yahoo.co.uk>2016-11-08 00:36:58 +0000
committerRico Tzschichholz <ricotz@ubuntu.com>2016-11-08 08:56:12 +0100
commit6dfc56a54544a129e91d11202d5f1c5424d57dab (patch)
treeacb76fcedfd9f198a9d35f78f63c44065ea692f9 /vala/valaproperty.vala
parentf365c42d81cc3cfcaf49e7ac9c2d63e9f0851f26 (diff)
downloadvala-6dfc56a54544a129e91d11202d5f1c5424d57dab.tar.gz
vala: check a property has an accessor and/or a mutator
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=773956
Diffstat (limited to 'vala/valaproperty.vala')
-rw-r--r--vala/valaproperty.vala6
1 files changed, 6 insertions, 0 deletions
diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala
index 9da3508ea..19aad24be 100644
--- a/vala/valaproperty.vala
+++ b/vala/valaproperty.vala
@@ -395,6 +395,12 @@ public class Vala.Property : Symbol, Lockable {
property_type.check (context);
+ if (get_accessor == null && set_accessor == null) {
+ error = true;
+ Report.error (source_reference, "Property `%s' must have a `get' accessor and/or a `set' mutator".printf (get_full_name ()));
+ return false;
+ }
+
if (get_accessor != null) {
get_accessor.check (context);
}