Files
kotlin/compiler/testData/codegen/box/enum/defaultCtor/constructorWithDefaultArguments.kt
Dmitry Petrov ee9a174c1f KT-7897 Do not require to call enum constructor for each entry if all parameters have default values
Do not report an error on enum entry without initializer if all parameters have default values
(error is still reported if there is no such constructor, or if the constructor call is ambiguous).

Record resolved call on KtEnumEntry.

NB is the enum entry has a corresponding subclass, we still have to generate the "default" constructor call,
because FE doesn't know about the platform-specific representation of that class and its constructors.

See also KT-14097, KT-15900
2017-01-24 16:59:47 +03:00

6 lines
91 B
Kotlin
Vendored

enum class Test(val str: String = "OK") {
OK
}
fun box(): String =
Test.OK.str