mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 08:31:29 +00:00
These tests check behavior of an old language version on purpose: the original bug KT-24708 has been fixed by introducing an error here in 1.4.
20 lines
250 B
Kotlin
Vendored
20 lines
250 B
Kotlin
Vendored
// !LANGUAGE: -ProhibitComparisonOfIncompatibleEnums
|
|
// IGNORE_BACKEND_FIR: JVM_IR
|
|
|
|
enum class A {
|
|
OK
|
|
}
|
|
|
|
enum class B {
|
|
FAIL
|
|
}
|
|
|
|
fun f() = A.OK
|
|
|
|
fun box(): String {
|
|
return when (f()) {
|
|
B.FAIL -> "fail"
|
|
A.OK -> "OK"
|
|
}
|
|
}
|