MCPcopy Index your code
hub / github.com/clojure/clojure / coerceAdapterReturn

Method coerceAdapterReturn

src/jvm/clojure/lang/Reflector.java:579–592  ·  view source on GitHub ↗
(Object ret, Class targetType)

Source from the content-addressed store, hash-verified

577
578// Return type coercions match coercions in FnInvokers for compiled invokers
579private 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
594static Object boxArg(Class paramType, Object arg){
595 if(arg instanceof IFn && Compiler.FISupport.maybeFIMethod(paramType) != null && !(paramType.isInstance(arg)))

Callers 1

boxArgMethod · 0.95

Calls 9

booleanCastMethod · 0.95
longCastMethod · 0.95
doubleCastMethod · 0.95
intCastMethod · 0.95
shortCastMethod · 0.95
byteCastMethod · 0.95
floatCastMethod · 0.95
isPrimitiveMethod · 0.80
getNameMethod · 0.65

Tested by

no test coverage detected