diff options
author | Alistair Thomas <astavale@yahoo.co.uk> | 2016-11-08 00:36:58 +0000 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-11-08 08:56:12 +0100 |
commit | 6dfc56a54544a129e91d11202d5f1c5424d57dab (patch) | |
tree | acb76fcedfd9f198a9d35f78f63c44065ea692f9 /vala/valaproperty.vala | |
parent | f365c42d81cc3cfcaf49e7ac9c2d63e9f0851f26 (diff) | |
download | vala-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.vala | 6 |
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); } |