fun foo() { when (a) { 1 -> { val x = 1 System.out.println(x) } 2 -> { val x = 2 System.out.println(x) } 3 -> { System.out.println(3) } } }