Class<?> rtype = dstType.returnType();
if (rtype != void.class && rtype.isPrimitive()) {
Wrapper srcWrapper = Wrapper.forBasicType(rtype);
Wrapper dstWrapper = srcWrapper.isSubwordOrInt() ? Wrapper.INT : srcWrapper; // widen subword to int
// boolean casts not allowed
emitPrimCast(srcWrapper.basicTypeChar(), dstWrapper.basicTypeChar());
emitBoxing(dstWrapper.primitiveType());
}
// If the return type is void we return a null reference.
if (rtype == void.class) {