KT-3750 When without else

#KT-3750 Fixed
This commit is contained in:
Nikolay Krasko
2013-07-05 20:19:22 +04:00
parent abcf5616f7
commit 21fa398380
5 changed files with 34 additions and 0 deletions
@@ -0,0 +1,15 @@
// KT-3750 When without else
enum class A {
e1
e2
}
class B(val a: A)
val B.foo: Int
get() {
// Check absence [NO_ELSE_IN_WHEN] error
return when (a) {
A.e1 -> 1
A.e2 -> 3
}
}