X-Git-Url: http://nitlanguage.org diff --git a/src/model/model.nit b/src/model/model.nit index 2de65f5..3d9a364 100644 --- a/src/model/model.nit +++ b/src/model/model.nit @@ -285,8 +285,9 @@ redef class MModule if name == "Bool" and self.model.get_mclasses_by_name("Object") != null then # Bool is injected because it is needed by engine to code the result # of the implicit casts. - var c = new MClass(self, name, null, enum_kind, public_visibility) - var cladef = new MClassDef(self, c.mclass_type, new Location(null, 0,0,0,0)) + var loc = model.no_location + var c = new MClass(self, name, loc, null, enum_kind, public_visibility) + var cladef = new MClassDef(self, c.mclass_type, loc) cladef.set_supertypes([object_type]) cladef.add_in_hierarchy return c @@ -554,6 +555,8 @@ class MClass # Is `self` and abstract class? var is_abstract: Bool is lazy do return kind == abstract_kind + + redef fun mdoc_or_fallback do return intro.mdoc_or_fallback end @@ -1166,6 +1169,8 @@ class MClassType redef fun model do return self.mclass.intro_mmodule.model + redef fun location do return mclass.location + # TODO: private init because strongly bounded to its mclass. see `mclass.mclass_type` # The formal arguments of the type @@ -1371,6 +1376,8 @@ class MVirtualType # Its the definitions of this property that determine the bound or the virtual type. var mproperty: MVirtualTypeProp + redef fun location do return mproperty.location + redef fun model do return self.mproperty.intro_mclassdef.mmodule.model redef fun lookup_bound(mmodule: MModule, resolved_receiver: MType): MType @@ -1501,6 +1508,8 @@ class MParameterType redef fun model do return self.mclass.intro_mmodule.model + redef fun location do return mclass.location + # The position of the parameter (0 for the first parameter) # FIXME: is `position` a better name? var rank: Int @@ -1626,6 +1635,8 @@ abstract class MProxyType # The base type var mtype: MType + redef fun location do return mtype.location + redef fun model do return self.mtype.model redef fun need_anchor do return mtype.need_anchor redef fun as_nullable do return mtype.as_nullable @@ -1952,6 +1963,10 @@ abstract class MProperty # The (short) name of the property redef var name + redef var location + + redef fun mdoc_or_fallback do return intro.mdoc_or_fallback + # The canonical name of the property. # # It is currently the short-`name` prefixed by the short-name of the class and the full-name of the module.