Files
kotlin-fork/compiler/testData/diagnostics/tests/enum/InsideEntryConstructorCall.kt
T
Nikolay Lunyak e4246e8f51 [FIR] Support ENUM_CLASS_CONSTRUCTOR_CALL
^KT-59411 Fixed
2023-08-04 11:20:40 +00:00

16 lines
366 B
Kotlin
Vendored

// FIR_IDENTICAL
// KT-7753: attempt to call enum constructor explicitly
enum class A(val c: Int) {
ONE(1) {
override fun selfOrFriend(): A {
return this
}
},
TWO(2) {
override fun selfOrFriend(): A {
return <!ENUM_CLASS_CONSTRUCTOR_CALL!>A(42)<!>
}
};
abstract fun selfOrFriend(): A
}