start removing implicit properties
[nit.git] / src / syntax / syntax_base.nit
index e35b117..d1fc546 100644 (file)
@@ -185,6 +185,8 @@ class Variable
        # Static type
        readable writable attr _stype: MMType 
 
+       redef meth to_s do return _name.to_s
+
        init(n: Symbol, d: PNode)
        do
                assert n != null
@@ -292,6 +294,8 @@ special Visitor
                if subtype < stype then
                        return true
                end
+               #error(n, "Type error: expected {stype}'{stype.module}, got {subtype}'{subtype.module}")
+               #abort
                error(n, "Type error: expected {stype}, got {subtype}")
                return false
        end
@@ -433,7 +437,7 @@ redef class AType
                                v.error(self, "Type error: formal type {name} cannot have formal parameters.")
                                return null
                        end
-                       var t = cla.get_type.select_virtual_type(name).stype
+                       var t = cla.get_type.select_virtual_type(name).stype_for(cla.get_type)
                        if t == null then
                                v.error(self, "Type error: circular definition in formal type {name}.")
                                return null
@@ -497,3 +501,19 @@ redef class PExpr
        # Is null for statement and for erronus expression
        meth stype: MMType is abstract
 end
+
+redef class AVardeclExpr
+       # Assiociated local variable
+       readable writable attr _variable: Variable
+end
+
+redef class AForVardeclExpr
+       # Associated automatic local variable
+       readable writable attr _variable: Variable
+end
+
+redef class AVarFormExpr
+       # Associated local variable
+       readable writable attr _variable: Variable 
+end
+