Files
kotlin-fork/compiler/testData/diagnostics/tests/enum/ifEnumEntry.fir.kt
T
Tianyu Geng c648356887 FIR: report ENUM_ENTRY_AS_TYPE and IS_ENUM_TYPE
These two diagnostics are similar: both are reported on type references
to enum entries. But `IS_ENUM_TYPE` is reported if the type ref is an
operand of `is` operator. To pass along this contextual information, a
boolean is added to FirSpecificTypeResolverTransformer.
2021-07-22 20:39:56 +03:00

7 lines
136 B
Kotlin
Vendored

enum class MyEnum {
FIRST,
SECOND
}
fun foo(me: MyEnum): Boolean = if (me is <!IS_ENUM_ENTRY!>MyEnum.FIRST<!>) true else false