a4732b442d
This proved to be a fragile technique, which probably doesn't even improve performance in most cases but has lots of unexpected problems: unconditional initialization of reflection classes, increasing the size of the bytecode, bugs with <clinit> in annotations on JVM 6, inability to support conversion of a class from Kotlin to Java without recompiling clients which use it reflectively, etc.
15 lines
296 B
Kotlin
Vendored
15 lines
296 B
Kotlin
Vendored
import kotlin.reflect.jvm.kotlin
|
|
|
|
enum class A {
|
|
// There's a synthetic field "$VALUES" here
|
|
}
|
|
|
|
fun box(): String {
|
|
for (field in javaClass<A>().getDeclaredFields()) {
|
|
val prop = field.kotlin
|
|
if (prop != null) return "Fail, property found: $prop"
|
|
}
|
|
|
|
return "OK"
|
|
}
|