Support "Lift return out of when" for exhaustive when without else

So #KT-18852 Fixed
This commit is contained in:
Toshiaki Kameyama
2017-07-21 13:46:03 +03:00
committed by Mikhail Glukhikh
parent 9781d1fcdf
commit c3988ef184
12 changed files with 175 additions and 2 deletions
@@ -0,0 +1,15 @@
enum class TestEnum{
A, B, C
}
fun test(e: TestEnum): Int {
var res: Int = 0
<caret>when (e) {
TestEnum.A -> res = 1
TestEnum.B -> res = 2
TestEnum.C -> res = 3
}
return res
}