diff options
author | Jürg Billeter <j@bitron.ch> | 2009-06-15 08:28:30 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2009-06-15 13:47:52 +0200 |
commit | a383d0177b997906a8241b5b2c33aa9c93340553 (patch) | |
tree | e175a5c5e3feff8a60bfc270ca2a92589c5313c8 /vala/valaproperty.vala | |
parent | 30c45d0744aeb29f420b98053bd7062fab37bcfe (diff) | |
download | vala-a383d0177b997906a8241b5b2c33aa9c93340553.tar.gz |
Fix type checks for virtual and abstract properties
Take ownership into account when checking inherited properties.
Diffstat (limited to 'vala/valaproperty.vala')
-rw-r--r-- | vala/valaproperty.vala | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala index edcd65643..e00510c82 100644 --- a/vala/valaproperty.vala +++ b/vala/valaproperty.vala @@ -305,10 +305,6 @@ public class Vala.Property : Member, Lockable { * property */ public bool equals (Property prop2) { - if (!prop2.property_type.equals (property_type)) { - return false; - } - if ((get_accessor == null && prop2.get_accessor != null) || (get_accessor != null && prop2.get_accessor == null)) { return false; @@ -319,7 +315,21 @@ public class Vala.Property : Member, Lockable { return false; } + if (get_accessor != null) { + // check accessor value_type instead of property_type + // due to possible ownership differences + if (!prop2.get_accessor.value_type.equals (get_accessor.value_type)) { + return false; + } + } + if (set_accessor != null) { + // check accessor value_type instead of property_type + // due to possible ownership differences + if (!prop2.set_accessor.value_type.equals (set_accessor.value_type)) { + return false; + } + if (set_accessor.writable != prop2.set_accessor.writable) { return false; } |