square/retrofit

Calling a Java interface in Kotlin and using the await() extension function

senselesscn opened this issue · 0 comments

version: 2.11.0

In java:

@GET("xxx")
Call<ApiResult> getRecommendCity();

In kotlin:
httpService.getRecommendCity().await();

Get an error:

Overload resolution ambiguity. All these functions match.
public suspend fun <T : Any> Call<TypeVariable(T)>.await(): TypeVariable(T) defined in retrofit2
public suspend fun <T : Any> Call<TypeVariable(T)?>.await(): TypeVariable(T)? defined in retrofit2