nitc/model: add location to MType
authorJean Privat <jean@pryen.org>
Sun, 1 May 2016 18:55:03 +0000 (14:55 -0400)
committerJean Privat <jean@pryen.org>
Fri, 13 May 2016 20:38:51 +0000 (16:38 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/model/model.nit

index 00f8052..9aefe19 100644 (file)
@@ -1167,6 +1167,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
@@ -1372,6 +1374,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
@@ -1502,6 +1506,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
@@ -1627,6 +1633,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