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:
+2
-2
@@ -1,7 +1,7 @@
|
||||
import kotlin.reflect.jvm.kotlin
|
||||
|
||||
class A {
|
||||
// There's a synthetic "$kotlinClass" field here
|
||||
enum class A {
|
||||
// There's a synthetic field "$VALUES" here
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
Reference in New Issue
Block a user