FIR: implement resolve of unqualified enum references in when

See KT-16768
This commit is contained in:
Mikhail Glukhikh
2022-02-17 14:13:14 +03:00
committed by teamcity
parent f35b4b7515
commit 981f8b1871
28 changed files with 820 additions and 34 deletions
@@ -0,0 +1,32 @@
enum class Outer {
FIRST, SECOND;
}
enum class Inner {
SECOND, THIRD;
}
fun foo(o: Outer, i: Inner): Int {
return when (o) {
FIRST -> 1
SECOND -> when (i) {
SECOND -> 2
THIRD -> 3
}
}
}
fun bar(o: Outer, i: Inner): Int {
return when (o) {
FIRST -> 1
SECOND -> {
fun baz(): Int {
return when (i) {
SECOND -> 2
THIRD -> 3
}
}
baz()
}
}
}