compiler: resolve types when doing new NativeArray
authorJean Privat <jean@pryen.org>
Wed, 19 Nov 2014 02:08:03 +0000 (21:08 -0500)
committerJean Privat <jean@pryen.org>
Wed, 19 Nov 2014 02:08:03 +0000 (21:08 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/compiler/global_compiler.nit

index 510b1ac..94dda37 100644 (file)
@@ -396,6 +396,7 @@ class GlobalCompilerVisitor
        redef fun native_array_instance(elttype: MType, length: RuntimeVariable): RuntimeVariable
        do
                var ret_type = self.get_class("NativeArray").get_mtype([elttype])
+               ret_type = anchor(ret_type).as(MClassType)
                return self.new_expr("NEW_{ret_type.c_name}({length})", ret_type)
        end