Support "Lift return out of when" for exhaustive when without else
So #KT-18852 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
9781d1fcdf
commit
c3988ef184
+16
@@ -0,0 +1,16 @@
|
||||
// PROBLEM: none
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user