CFG exhaustive when else instruction for KT-8700

This commit is contained in:
Mikhail Glukhikh
2015-12-14 16:08:01 +03:00
committed by Mikhail Glukhikh
parent 697228eae0
commit b805ce06c2
25 changed files with 446 additions and 51 deletions
@@ -0,0 +1,14 @@
enum class Direction {
NORTH, SOUTH, WEST, EAST
}
fun foo(dir: Direction): Int {
val res: Int
when (dir) {
Direction.NORTH -> res = 1
Direction.SOUTH -> res = 2
Direction.WEST -> res = 3
Direction.EAST -> res = 4
}
return res
}