what's the recommended solution for: ``` object Ba...
# announcements
v
what's the recommended solution for:
Copy code
object Bar {
    var a: MyKlass? = null

    fun foo() {
        if (a != null) {
            a.doSomething() // smart casting won't work here
        } 
    }
}
I usually write
a.let { if (it != null) it.doSomething() }
is it a code smell also?