Hey,
I updated my Kotlin code for Square Retrofit 2.0.0-SNAPSHOT (https://github.com/square/retrofit) and the compiler (Kotlin 0.12.613) started to complain.
Here is my attempt to reproduce this issue completely in Kotlin (http://try.kotlinlang.org/#/UserProjects/hl1mlli7si1md8pkkpnkartgs3/enu98juf78rprj5vhe5fuu3ea6):
data class Model
class Response<T> {
private constructor() {}
}
interface Callback<T> {
fun onResponse(response: Response<T>)
fun onFailure(failure: Throwable)
}
fun main(args: Array<String>) {
val callback = object : Callback<Model> {
override fun onResponse(response: Response<Model>) {}
override fun onFailure(failure: Throwable) {}
}
}
This unfortunately did not reproduce the error, but might provide an insight about the problem. If I replace my Response in Kotlin with the Response class in Java (https://github.com/square/retrofit/blob/f15eee44ed/retrofit/src/main/java/retrofit/Response.java#L71) the compiler will output following error message:
'Response' is not an annotation class. Cannot access '<init>': it is 'private' in 'Response'. No value passed for parameter body. No value passed for parameter errorBody. No value passed for parameter rawResponse. A type annotation is required on a value parameter.
–Benjamin