https://kotlinlang.org logo
#getting-started
Title
# getting-started
v

vineethraj49

02/09/2021, 11:12 AM
do we have some documentation for this behavior?
Copy code
val foo: String
// foo cannot be used yet
if (cond) {
  ...
  foo = "a"
  ...
  foo can be used here
} else {
  ...
  foo = "b"
  ...
  foo can be used here
}

// foo can be used now