vala r1540 - in trunk: . vala
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1540 - in trunk: . vala
- Date: Mon, 2 Jun 2008 12:36:07 +0000 (UTC)
Author: juergbi
Date: Mon Jun 2 12:36:07 2008
New Revision: 1540
URL: http://svn.gnome.org/viewvc/vala?rev=1540&view=rev
Log:
2008-06-02 JÃrg Billeter <j bitron ch>
* vala/valasemanticanalyzer.vala:
Ensure that classes implement abstract properties of interfaces
and abstract base classes, fixes bug 535270
Modified:
trunk/ChangeLog
trunk/vala/valasemanticanalyzer.vala
Modified: trunk/vala/valasemanticanalyzer.vala
==============================================================================
--- trunk/vala/valasemanticanalyzer.vala (original)
+++ trunk/vala/valasemanticanalyzer.vala Mon Jun 2 12:36:07 2008
@@ -207,6 +207,17 @@
}
}
}
+
+ /* check properties */
+ foreach (Property prop in iface.get_properties ()) {
+ if (prop.is_abstract) {
+ var sym = cl.scope.lookup (prop.name);
+ if (!(sym is Property)) {
+ cl.error = true;
+ Report.error (cl.source_reference, "`%s' does not implement interface property `%s'".printf (cl.get_full_name (), prop.get_full_name ()));
+ }
+ }
+ }
}
}
@@ -223,6 +234,15 @@
}
}
}
+ foreach (Property base_property in base_class.get_properties ()) {
+ if (base_property.is_abstract) {
+ var override_property = symbol_lookup_inherited (cl, base_property.name) as Property;
+ if (override_property == null || !override_property.overrides) {
+ cl.error = true;
+ Report.error (cl.source_reference, "`%s' does not implement abstract property `%s'".printf (cl.get_full_name (), base_property.get_full_name ()));
+ }
+ }
+ }
base_class = base_class.base_class;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]