Source:
static <ResponseT, ReturnT> HttpServiceMethod<ResponseT, ReturnT> parseAnnotations( Retrofit retrofit, Method method, RequestFactory requestFactory) { CallAdapter<ResponseT, ReturnT> callAdapter = null; boolean continuationWantsResponse = false; Type responseType; if (requestFactory.isKotlinSuspendFunction) { Type[] parameterTypes = method.getGenericParameterTypes(); Type continuationType = parameterTypes[parameterTypes.length - 1]; Type innerType = Utils.getParameterLowerBound(0, (ParameterizedType) continuationType); Class<?> rawInnerType = Utils.getRawType(innerType); if (rawInnerType == Response.class) { if (!(innerType instanceof ParameterizedType)) { throw methodError(method, "Response must include generic type (e.g., Response<String>)"); } responseType = Utils.getParameterUpperBound(0, (ParameterizedType) innerType); continuationWantsResponse = true; } else { responseType = innerType; } } else { callAdapter = createCallAdapter(retrofit, method); responseType = callAdapter.responseType(); } if (responseType == Response.class || responseType == okhttp3.Response.class) { throw methodError(method, "'" + Utils.getRawType(responseType).getName() + "' is not a valid response body type. Did you mean ResponseBody?"); } if (requestFactory.httpMethod.equals("HEAD") && !Void.class.equals(responseType)) { throw methodError(method, "HEAD method must use Void as response type."); } Converter<ResponseBody, ResponseT> responseConverter = createResponseConverter(retrofit, method, responseType); okhttp3.Call.Factory callFactory = retrofit.callFactory; return new HttpServiceMethod<>(requestFactory, callFactory, callAdapter, continuationWantsResponse, responseConverter); }

Target:
static <ResponseT, ReturnT> HttpServiceMethod<ResponseT, ReturnT> parseAnnotations( Retrofit retrofit, Method method, RequestFactory requestFactory) { CallAdapter<ResponseT, ReturnT> callAdapter = null; boolean continuationWantsResponse = false; boolean continuationBodyNullable = false; Type responseType; if (requestFactory.isKotlinSuspendFunction) { Type[] parameterTypes = method.getGenericParameterTypes(); Type continuationType = parameterTypes[parameterTypes.length - 1]; responseType = Utils.getParameterLowerBound(0, (ParameterizedType) continuationType); if (getRawType(responseType) == Response.class && responseType instanceof ParameterizedType) { responseType = Utils.getParameterUpperBound(0, (ParameterizedType) responseType); continuationWantsResponse = true; } else { } } else { callAdapter = createCallAdapter(retrofit, method); responseType = callAdapter.responseType(); } if (responseType == okhttp3.Response.class) { throw methodError(method, "'" + getRawType(responseType).getName() + "' is not a valid response body type. Did you mean ResponseBody?"); } if (responseType == Response.class) { throw methodError(method, "Response must include generic type (e.g., Response<String>)"); } if (requestFactory.httpMethod.equals("HEAD") && !Void.class.equals(responseType)) { throw methodError(method, "HEAD method must use Void as response type."); } Converter<ResponseBody, ResponseT> responseConverter = createResponseConverter(retrofit, method, responseType); okhttp3.Call.Factory callFactory = retrofit.callFactory; if (callAdapter != null) { return new CallAdapted<>(requestFactory, callFactory, callAdapter, responseConverter); } else if (continuationWantsResponse) { return (HttpServiceMethod<ResponseT, ReturnT>) new SuspendForResponse<>(requestFactory, callFactory, responseConverter); } else { return (HttpServiceMethod<ResponseT, ReturnT>) new SuspendForBody<>(requestFactory, callFactory, responseConverter, continuationBodyNullable); } }