modelbuilder: node is optionnal in Modelbuilder::force_get_primitive_method
[nit.git] / src / compiler / separate_compiler.nit
index 1032c21..8c400f9 100644 (file)
@@ -1762,7 +1762,7 @@ class SeparateCompilerVisitor
        redef fun calloc_array(ret_type, arguments)
        do
                var mclass = self.get_class("ArrayCapable")
-               var ft = mclass.mclass_type.arguments.first.as(MParameterType)
+               var ft = mclass.mparameters.first
                var res = self.native_array_instance(ft, arguments[1])
                self.ret(res)
        end
@@ -1972,7 +1972,12 @@ redef class MPropDef
        fun const_color: String do return "COLOR_{c_name}"
 end
 
-redef class AExternInitPropdef
+redef class AMethPropdef
        # The semi-global compilation does not support inlining calls to extern news
-       redef fun can_inline do return false
+       redef fun can_inline
+       do
+               var m = mpropdef
+               if m != null and m.mproperty.is_init and m.is_extern then return false
+               return super
+       end
 end