Suggestion: Static local variables

You can easily simulate that with an object:

object Counter {
  private var counter = 0
  fun count(): Int = counter++
}

I don’t think adding a feature for this to be much worthwhile.

4 Likes