fun do_typing(modelbuilder: ModelBuilder)
do
end
+
+ # The variable associated to the reciever (if any)
+ var selfvariable: nullable Variable
end
redef class AConcreteMethPropdef
var nclassdef = self.parent.as(AClassdef)
var mpropdef = self.mpropdef.as(not null)
var v = new TypeVisitor(modelbuilder, nclassdef, mpropdef)
+ self.selfvariable = v.selfvariable
var nblock = self.n_block
if nblock == null then return
do
var nclassdef = self.parent.as(AClassdef)
var v = new TypeVisitor(modelbuilder, nclassdef, self.mpropdef.as(not null))
+ self.selfvariable = v.selfvariable
var nexpr = self.n_expr
if nexpr != null then
# null if self is a statement of in case of error
var mtype: nullable MType = null
- # Is the statement correctly typed.
+ # Is the statement correctly typed?
# Used to distinguish errors and statements when `mtype' == null
var is_typed: Bool = false
end
if mtype == null then
- mtype = v.get_mclass(self, "Object").mclass_type
+ mtype = v.get_mclass(self, "Object").mclass_type.as_nullable
end
variable.declared_type = mtype