An implementation of KT-7753: now enum constructors cannot be called explicitly.
Several tests are provided. #KT-7753 Fixed.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// KT-7753: attempt to call enum constructor explicitly
|
||||
enum class A(val c: Int) {
|
||||
ONE(1),
|
||||
TWO(2),
|
||||
THREE(3),
|
||||
FOURTY_TWO();
|
||||
|
||||
var last: A? = null
|
||||
|
||||
constructor(): this(42) {
|
||||
last = <!ENUM_CLASS_CONSTRUCTOR_CALL!>A(13)<!>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user