mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-13 08:31:31 +00:00
15 lines
349 B
Kotlin
Vendored
15 lines
349 B
Kotlin
Vendored
// 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
|
|
} |