```if (foo != null) { // do something, foo now no...
# announcements
g
Copy code
if (foo != null) {
 // do something, foo now non-null
} else {
  otherStuff()
}
Kotlin compiler understands such pattern and allows you to use foo as non-null after check (if foo is immutable)