readable writable attr _formal_dict: Map[Symbol, MMTypeFormalParameter]
# Concrete NIT source properties by name
- readable attr _src_local_properties: Map[Symbol, MMConcreteProperty]
+ readable attr _src_local_properties: Map[Symbol, MMLocalProperty]
init(n: Symbol, cla: PClassdef, a: Int)
do
super(n, a)
_nodes = [cla]
- _src_local_properties = new HashMap[Symbol, MMConcreteProperty]
+ _src_local_properties = new HashMap[Symbol, MMLocalProperty]
end
end
end
end
-redef class MMConcreteProperty
+redef class MMLocalProperty
# The attached node (if any)
meth node: PNode do return null
end
# Concrete NIT source attribute
class MMSrcAttribute
-special MMConcreteProperty
+special MMLocalProperty
special MMAttribute
redef readable attr _node: AAttrPropdef
init(name: Symbol, cla: MMLocalClass, n: AAttrPropdef)
do
- super(name, cla, self)
+ super(name, cla)
_node = n
end
end
# Concrete NIT source method
class MMSrcMethod
-special MMConcreteProperty
+special MMLocalProperty
special MMMethod
end
init(name: Symbol, cla: MMLocalClass, n: AAttrPropdef)
do
- super(name, cla, self)
+ super(name, cla)
_node = n
end
end
init(name: Symbol, cla: MMLocalClass, n: AAttrPropdef)
do
- super(name, cla, self)
+ super(name, cla)
_node = n
end
end
redef readable attr _node: AMethPropdef
init(name: Symbol, cla: MMLocalClass, n: AMethPropdef)
do
- super(name, cla, self)
+ super(name, cla)
_node = n
end
end
# Concrete NIT source virtual type
class MMSrcTypeProperty
-special MMConcreteProperty
+special MMLocalProperty
special MMTypeProperty
redef readable attr _node: ATypePropdef
init(name: Symbol, cla: MMLocalClass, n: ATypePropdef)
do
- super(name, cla, self)
+ super(name, cla)
_node = n
end
end
# 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
readable writable attr _local_class: MMSrcLocalClass
# The current property
- readable writable attr _local_property: MMConcreteProperty
+ readable writable attr _local_property: MMLocalProperty
# The current tool configuration/status
readable attr _tc: ToolContext
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
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.local_class.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
# 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
+