'Else' is not required in 'when' if Unit is expected
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
var r = "Fail 0"
|
||||
|
||||
fun foo(x: Int) {
|
||||
return when (x) {
|
||||
1 -> { r = "OK" }
|
||||
}
|
||||
}
|
||||
fun box(): String {
|
||||
foo(1)
|
||||
return r
|
||||
}
|
||||
Reference in New Issue
Block a user