(Object ret, Class targetType)
| 577 | |
| 578 | // Return type coercions match coercions in FnInvokers for compiled invokers |
| 579 | private static Object coerceAdapterReturn(Object ret, Class targetType) { |
| 580 | if(targetType.isPrimitive()) { |
| 581 | switch (targetType.getName()) { |
| 582 | case "boolean": return RT.booleanCast(ret); |
| 583 | case "long": return RT.longCast(ret); |
| 584 | case "double": return RT.doubleCast(ret); |
| 585 | case "int": return RT.intCast(ret); |
| 586 | case "short": return RT.shortCast(ret); |
| 587 | case "byte": return RT.byteCast(ret); |
| 588 | case "float": return RT.floatCast(ret); |
| 589 | } |
| 590 | } |
| 591 | return ret; |
| 592 | } |
| 593 | |
| 594 | static Object boxArg(Class paramType, Object arg){ |
| 595 | if(arg instanceof IFn && Compiler.FISupport.maybeFIMethod(paramType) != null && !(paramType.isInstance(arg))) |
no test coverage detected