summaryrefslogtreecommitdiff
path: root/vala/valaclass.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2017-03-07 23:12:37 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2017-03-10 18:34:40 +0100
commite874bb7902cc06f9f6d4427d99ec33e3757304e4 (patch)
tree32e451a0c41a68b387ca559498a794763a530a17 /vala/valaclass.vala
parent616f94536eddb2735360f38ff29e40e3dc277fd1 (diff)
downloadvala-e874bb7902cc06f9f6d4427d99ec33e3757304e4.tar.gz
class: Perform more thorough compatibility check of inherited properties
https://bugzilla.gnome.org/show_bug.cgi?id=779038
Diffstat (limited to 'vala/valaclass.vala')
-rw-r--r--vala/valaclass.vala7
1 files changed, 7 insertions, 0 deletions
diff --git a/vala/valaclass.vala b/vala/valaclass.vala
index b983319be..211c321dd 100644
--- a/vala/valaclass.vala
+++ b/vala/valaclass.vala
@@ -819,6 +819,13 @@ public class Vala.Class : ObjectTypeSymbol {
base_class = base_class.base_class;
}
if (sym is Property) {
+ var base_prop = (Property) sym;
+ string? invalid_match = null;
+ // No check at all for "new" classified properties, really?
+ if (!base_prop.hides && !base_prop.compatible (prop, out invalid_match)) {
+ error = true;
+ Report.error (source_reference, "Type and/or accessors of inherited properties `%s' and `%s' do not match: %s.".printf (prop.get_full_name (), base_prop.get_full_name (), invalid_match));
+ }
// property is used as interface implementation, so it is not unused
sym.version.check (source_reference);
sym.used = true;