Is it possible to provide extra hints to the Kotli...
# android
y
Is it possible to provide extra hints to the Kotlin type inference? For example:
Copy code
fun processResponse(res: Response) {
  if (res.isSucceess()) {
    updateUi(res.body)
  }
}
fun updateUi(data: Data) {
}
class Response(val data: Data? = null) {
  fun isSuccess(): Boolean {...}
}
In this example, I'd like to create a contract that
Response.data
will never be null if
isSuccess()
return
true
. I can't seem to find anything (I assume it'd have to be an annotation) that would do this.