Isn't there an annotation or something i can use t...
# announcements
h
Isn't there an annotation or something i can use to tell the compiler to smart-cast
Connection
to not null?
Copy code
private val Connection?.isUsable get() = this != null && !isClosed
d
I am not sure what is your question about, do you want a solution like this?
Copy code
class Connection() {

    val isUsable: Boolean = true
    val isClosed: Boolean = true

    private val Connection.isUsable get() =  !isClosed

}