bakert
12/06/2018, 9:09 PMclass GoodException(message: String) : RuntimeException(message)
class MessageThing(val exception: RuntimeException) {
fun message(): String {
return when (this.exception) {
is GoodException -> this.exception.message
else -> "An error occurred."
}
}
}
Why doesn't message
understand that this.exception.message will always return a String there, and can I tell it without `!!/
?:`?