Keep built-in metadata for reflection interfaces
Reflection interfaces (interfaces in kotlin.reflect.* in core/builtins/) are now fully considered as built-ins and can be accessed via KotlinBuiltIns. This increases runtime size by ~20kb, but only because KotlinBuiltIns is static and is therefore constructed only via resource loading from the compiler classpath at the moment. As soon as it's possible to inject KotlinBuiltIns to the particular resolution process, the metadata on JVM will be loaded via standard annotation mechanism (kotlin.jvm.internal.KotlinClass/KotlinPackage) and wasted runtime space will be reclaimed
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
fun foo() {}
|
||||
|
||||
class A(val prop: Any) {
|
||||
fun baz() {}
|
||||
}
|
||||
|
||||
val topLevelFun = <!REFLECTION_TYPES_NOT_LOADED!>::<!>foo
|
||||
val memberFun = A<!REFLECTION_TYPES_NOT_LOADED!>::<!>baz
|
||||
|
||||
val classLiteral = A<!REFLECTION_TYPES_NOT_LOADED!>::<!>class
|
||||
val property = A<!REFLECTION_TYPES_NOT_LOADED!>::<!>prop
|
||||
@@ -1,16 +0,0 @@
|
||||
package
|
||||
|
||||
internal val classLiteral: [ERROR : Unresolved class]
|
||||
internal val memberFun: [ERROR : Type for A::baz]
|
||||
internal val property: [ERROR : Type for A::prop]
|
||||
internal val topLevelFun: [ERROR : Type for ::foo]
|
||||
internal fun foo(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A(/*0*/ prop: kotlin.Any)
|
||||
internal final val prop: kotlin.Any
|
||||
internal final fun baz(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -4,8 +4,8 @@ kotlin.deprecated(value = "message": kotlin.String) internal fun Obsolete(/*0*/
|
||||
internal fun block(): kotlin.Unit
|
||||
internal fun expression(): UsefulClass
|
||||
internal fun invoker(): kotlin.Unit
|
||||
internal fun reflection(): [ERROR : Error function type]
|
||||
internal fun reflection2(): [ERROR : Error function type]
|
||||
internal fun reflection(): kotlin.reflect.KFunction1<kotlin.Int, UsefulClass>
|
||||
internal fun reflection2(): kotlin.reflect.KMemberFunction0<UsefulClass, kotlin.Unit>
|
||||
kotlin.deprecated(value = "does nothing good": kotlin.String) internal fun kotlin.Any.doNothing(): kotlin.String
|
||||
|
||||
internal final class Delegation {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// !DIAGNOSTICS: -REFLECTION_TYPES_NOT_LOADED -UNUSED_EXPRESSION
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
|
||||
fun test() {
|
||||
dynamic::foo
|
||||
@@ -6,4 +6,4 @@ fun test() {
|
||||
|
||||
class dynamic {
|
||||
fun foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user