mm: force inheritance when selectioning local property
authorJean Privat <jean@pryen.org>
Tue, 14 Feb 2012 19:39:34 +0000 (14:39 -0500)
committerJean Privat <jean@pryen.org>
Wed, 15 Feb 2012 20:47:52 +0000 (15:47 -0500)
Because of some optimizations, the inheritance is not always performed
on classes. The selection of a local property is not aware of that and
access thing event if the inheritance is not computed.

This patch force the inheritance if the global property is not found.

Signed-off-by: Jean Privat <jean@pryen.org>

src/metamodel/inheritance.nit

index f7326d2..9c7bfe1 100644 (file)
@@ -274,6 +274,12 @@ redef class MMLocalClass
                        return _local_property_by_global[glob]
                else if has_global_property(glob) then
                        return inherit_local_property(glob)
+               else if not computed_super_classes then
+                       compute_super_classes
+                       computed_ancestors
+                       inherit_global_properties
+                       assert has_global_property(glob)
+                       return inherit_local_property(glob)
                else
                        abort
                end