Mapper mapper = type_mapper.get(type);
if (mapper != null) {
return mapper.map(val);
}
final EFun ifun;
if (type.isInterface() && (ifun = val.testFunction2(3)) != null) {
final ClassLoader loader = JavaObject.class
.getClassLoader();
return
java.lang.reflect.Proxy.newProxyInstance(loader, new Class[] { type }, new InvocationHandler() {
@Override
public Object invoke(Object proxy, final Method method, final Object[] args)
throws Throwable {
final Mailbox<Object> reply = new Mailbox<Object>(1);
EFun job = EFunCG.get_fun_with_handler("erlang", "apply", 0, new EFunHandler() {
@Override
public EObject invoke(EProc proc, EObject[] _) throws Pausable {
EObject aa = JavaObject.box(proc, args);
EObject at = JavaObject.box(proc, method.getParameterTypes());