Generate private constructors for Enums

#KT-2680 Fixed
  #KT-16867 Fixed
This commit is contained in:
Mikhael Bogdanov
2018-09-18 10:32:21 +02:00
parent c753a98d02
commit 38652372ce
11 changed files with 99 additions and 14 deletions
@@ -0,0 +1,25 @@
// TARGET_BACKEND: JVM
// FILE: Foo.java
public class Foo {
static String test() {
return KEnum.O.name() + KEnum.O.getValue();
}
}
// FILE: KEnum.kt
@Retention(AnnotationRetention.RUNTIME)
annotation class A
enum class KEnum(@A val value: Any) {
O("K") {
fun foo() {}
}
}
fun box(): String {
return Foo.test()
}