Don't create KClass and KPackage instances in <clinit>
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.
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
@kotlin.jvm.internal.KotlinClass A {
|
||||
public synthetic field $kotlinClass: kotlin.reflect.KClass
|
||||
private @AnnField field p: int
|
||||
private @AnnField field x: int
|
||||
private field y: int
|
||||
method <clinit>(): void
|
||||
private synthetic deprecated @AnnProp @AnnProp2 method p$annotations(): void
|
||||
public @AnnGetter method getP(): int
|
||||
public @AnnSetter method setP(@AnnParam p0: int): void
|
||||
@@ -24,4 +22,4 @@
|
||||
|
||||
@java.lang.annotation.Retention @kotlin.jvm.internal.KotlinClass AnnProp2
|
||||
|
||||
@java.lang.annotation.Retention @kotlin.jvm.internal.KotlinClass AnnSetter
|
||||
@java.lang.annotation.Retention @kotlin.jvm.internal.KotlinClass AnnSetter
|
||||
|
||||
Reference in New Issue
Block a user