KT-694 - support for simple enums
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
enum class Test {
|
||||
A
|
||||
B
|
||||
C
|
||||
}
|
||||
|
||||
fun checkA(a: Test) = when(a) {
|
||||
Test.B -> false
|
||||
Test.A -> true
|
||||
else -> false
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
if(!checkA(Test.A)) return "fail"
|
||||
if( checkA(Test.C)) return "fail"
|
||||
if( checkA(Test.B)) return "fail"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user