Add default values for some primitive type attributes.
[nit.git] / src / metamodel / inheritance.nit
index 15ac695..dd6a9ba 100644 (file)
@@ -59,7 +59,7 @@ redef class MMLocalClass
 
        # Is the class computing super.
        # Used to detect specialization loops.
-       attr _computing_super: Bool 
+       attr _computing_super: Bool = false 
 
        # Compute super classes of a class
        meth compute_super_classes
@@ -130,19 +130,26 @@ redef class MMLocalClass
                                        continue
                                end
 
-                               var gname = glob.intro.name
-                               var conf_set: Array[MMGlobalProperty]
-                               if names.has_key(gname) then
-                                       conf_set = names[gname]
-                               else
-                                       conf_set = new Array[MMGlobalProperty]
-                                       names[gname] = conf_set
-                               end
-                               conf_set.add(glob)
+                               make_visible_an_inherited_global_property(glob)
                        end
                end
        end
 
+       # Make the name of a global property meaningful in the class
+       meth make_visible_an_inherited_global_property(glob: MMGlobalProperty)
+       do
+               var names = _properties_by_name
+               var gname = glob.intro.name
+               var conf_set: Array[MMGlobalProperty]
+               if names.has_key(gname) then
+                       conf_set = names[gname]
+               else
+                       conf_set = new Array[MMGlobalProperty]
+                       names[gname] = conf_set
+               end
+               conf_set.add(glob)
+       end
+
        # Add super stype of this current local class
        meth add_direct_parent(p: MMAncestor)
        do