Next piece of ignorance: ``` class GoodException(m...
# announcements
b
Next piece of ignorance:
Copy code
class 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 `!!
/
?:`?