#elttype = elttype.anchor_to(self.mainmodule, v.receiver)
var vararg = self.mainmodule.get_primitive_class("Array").get_mtype([elttype])
v.add_type(vararg)
- v.add_monomorphic_send(vararg, self.modelbuilder.force_get_primitive_method(node, "with_native", vararg.mclass, self.mainmodule))
var native = self.mainmodule.get_primitive_class("NativeArray").get_mtype([elttype])
v.add_type(native)
+ v.add_monomorphic_send(vararg, self.modelbuilder.force_get_primitive_method(node, "with_native", vararg.mclass, self.mainmodule))
end
v.add_monomorphic_send(v.receiver, auto_super_init)
end
end
- else if npropdef isa AInternMethPropdef or npropdef isa AExternMethPropdef then
+ else if npropdef isa AInternMethPropdef or
+ (npropdef isa AExternMethPropdef and npropdef.n_extern != null) then
# UGLY: We force the "instantation" of the concrete return type if any
var ret = mmethoddef.msignature.return_mtype
if ret != null and ret isa MClassType and ret.mclass.kind != abstract_kind and ret.mclass.kind != interface_kind then
v.add_type(ret)
end
+ else if npropdef isa AExternMethPropdef then
+ var nclassdef = npropdef.parent.as(AClassdef)
+ v.enter_visit(npropdef)
else if npropdef isa AExternInitPropdef then
v.add_type(v.receiver)
else
redef fun visit(n)
do
- if n == null then return
n.accept_rapid_type_visitor(self)
if n isa AExpr then
var implicit_cast_to = n.implicit_cast_to
redef class AStringFormExpr
redef fun accept_rapid_type_visitor(v)
do
- var mtype = self.mtype.as(MClassType)
- v.add_type(mtype)
var native = v.get_class("NativeString").mclass_type
v.add_type(native)
- var prop = v.get_method(mtype, "from_cstring")
- v.add_monomorphic_send(mtype, prop)
+ var prop = v.get_method(native, "to_s_with_length")
+ v.add_monomorphic_send(native, prop)
end
end