denis.st
02/25/2016, 7:28 AMif (this.prop != null)
someMethod(this.prop)
Yep I’m agree that the smart cast here is not possible, so the simplest solution is to use a local variable:
val prop = this.prop
if (prop != null)
someMethod(prop)
Is there more elegant way to solve this? Swift has «if let prop = self.prop» check, maybe I missed something in Kotlin? simple smile