bendb
10/04/2019, 7:56 PMMap<KClass<*>, KSerializer<*>>
, which I believe does in fact require kotlin-reflect to materialize the entire KClass.Kirill Zhukov
10/04/2019, 9:52 PMbendb
10/04/2019, 11:21 PMbendb
10/05/2019, 12:04 AMInt::class.hashCode()
becomes
GETSTATIC java/lang/Integer.TYPE : Ljava/lang/Class;
INVOKESTATIC kotlin/jvm/internal/Reflection.getOrCreateKotlinClass (Ljava/lang/Class;)Lkotlin/reflect/KClass;
INVOKEINTERFACE kotlin/reflect/KClass.hashCode ()I (itf)
POP
which appears likely to involve kotlin-reflect
bendb
10/05/2019, 12:05 AMbendb
10/05/2019, 12:06 AMMarc Knaup
10/10/2019, 8:29 AMkotlin/jvm/internal/Reflection.getOrCreateKotlinClass
is a lightweight abstraction around Kotlin reflection. It uses either kotlin-reflect
if present or some limited kotlin-stdlib
magic if not. The latter includes creating KClass
instances with limited functionality. Putting them in a Map
is fine.
Also, the package kotlin.reflect
is kotlin-stdlib
and only kotlin.reflect.full
is kotlin-reflect
.bendb
10/10/2019, 10:04 PMkotlin-reflect
isn't on the classpath?