typing: ANew distinguish the type of the class and the returned type
[nit.git] / src / compiler / abstract_compiler.nit
index 50f3c8e..c785dd6 100644 (file)
@@ -2898,7 +2898,8 @@ end
 redef class ANewExpr
        redef fun expr(v)
        do
-               var mtype = self.mtype.as(MClassType)
+               var mtype = self.recvtype
+               assert mtype != null
                var recv
                var ctype = mtype.ctype
                if mtype.mclass.name == "NativeArray" then