typing: ANew distinguish the type of the class and the returned type
[nit.git] / src / interpreter / naive_interpreter.nit
index 6e4a356..12a54de 100644 (file)
@@ -1666,7 +1666,7 @@ end
 redef class ANewExpr
        redef fun expr(v)
        do
-               var mtype = v.unanchor_type(self.mtype.as(not null))
+               var mtype = v.unanchor_type(self.recvtype.as(not null))
                var recv: Instance = new MutableInstance(mtype)
                v.init_instance(recv)
                var args = v.varargize(callsite.mpropdef, recv, self.n_args.n_exprs)