Files
kotlin-fork/compiler/testData/diagnostics/tests/enum/OldSyntaxConstructorCall.kt
T
Mikhail Glukhikh 3c7225e83a An implementation of KT-7753: now enum constructors cannot be called explicitly.
Several tests are provided.
 #KT-7753 Fixed.
2015-05-25 17:27:31 +03:00

10 lines
329 B
Kotlin
Vendored

// KT-7753: attempt to call enum constructor explicitly
enum class A(val c: Int) {
// No errors at both places, but warnings about deprecated
ONE: <!ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR!>A(1)<!>,
TWO: <!ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR!>A(2)<!>;
fun getA(): A {
return ONE
}
}