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,33 @@
// FILE: first.kt
package first
enum class First {
ONE, TWO;
}
val THREE = First.ONE
// FILE: second.kt
package second
import first.First
import first.THREE
enum class Second {
THREE, FOUR;
}
val ONE = Second.THREE
fun foo(f: First) = <!NO_ELSE_IN_WHEN!>when<!> (f) {
<!INCOMPATIBLE_TYPES!>ONE<!> -> 1
TWO -> 2
}
fun bar(s: Second) = <!NO_ELSE_IN_WHEN!>when<!> (s) {
<!INCOMPATIBLE_TYPES!>THREE<!> -> 3
FOUR -> 4
}