How do you make a mutable property immutable insid...
# announcements
f
How do you make a mutable property immutable inside the local method scope? I'd do this:
Copy code
class Foo {
  var property: Int = 0 // mutable
  fun doSomething() {
    val property = property // 'property' is now immutable in scope
    // non atomic operations can be sure property won't change inside here
  }
}