+redef class AExternPropdef
+ redef fun fill_iroutine(v, method)
+ do
+ # add all explicit extern calls for this extern method
+ for explicit_import in method.as(MMMethSrcMethod).explicit_imports
+ do
+ var prop = explicit_import.method
+ var ic : IAbsCall
+ if prop.is_init then
+ ic = new INew(prop.signature.recv, prop, new List[IRegister])
+ else
+ ic = new ICall(prop, new List[IRegister])
+ end
+ ic.is_explicit_from_extern = true
+ v.stmt(ic)
+ end
+ end
+end
+
+redef class AExternInitPropdef
+ redef fun fill_iroutine(v, method)
+ do
+ var params = v.iroutine.params
+ var sig = method.signature
+ assert params.length == sig.arity + 1
+ var rtype = sig.recv # sig.return_type
+ v.add_assignment(new IRegister(rtype), v.expr(new INative(method, params), rtype))
+
+ super
+ end
+end
+