JVM IR: Do not create accessors for enum entry constructors

This commit is contained in:
Steven Schäfer
2020-07-17 16:16:07 +02:00
committed by Alexander Udalov
parent 71730696b2
commit d62a6a2631
4 changed files with 30 additions and 1 deletions
@@ -0,0 +1,15 @@
enum class E(private val value: Int) {
A(0) {
override fun f() {}
},
B(1) {
override fun f() {}
};
abstract fun f()
}
// The JVM BE creates an accessor for the constructor of `E`, but not for the constructors of the enum entry classes E$A and E$B.
// 1 public synthetic <init>\(Ljava/lang/String;IILkotlin/jvm/internal/DefaultConstructorMarker;\)V
// 2 INVOKESPECIAL E.<init> \(Ljava/lang/String;IILkotlin/jvm/internal/DefaultConstructorMarker;\)V
// 3 kotlin/jvm/internal/DefaultConstructorMarker;\)