This repository was archived by the owner on Jan 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
src/main/kotlin/com/wrongwrong/mapk/core Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import kotlin.reflect.KParameter
55import kotlin.reflect.full.instanceParameter
66import kotlin.reflect.jvm.isAccessible
77
8- internal class CompanionKFunction <T >(
8+ internal class KFunctionWithInstance <T >(
99 private val function : KFunction <T >,
1010 private val instance : Any
1111) : KFunction<T> by function {
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ internal fun <T : Any> getTarget(clazz: KClass<T>): KFunction<T> {
117117 clazz.companionObjectInstance?.let { companionObject ->
118118 companionObject::class .functions
119119 .filter { it.annotations.any { annotation -> annotation is KConstructor } }
120- .map { CompanionKFunction (it, companionObject) as KFunction <T > }
120+ .map { KFunctionWithInstance (it, companionObject) as KFunction <T > }
121121 } ? : emptyList()
122122
123123 val constructors: List <KFunction <T >> = factoryConstructor + clazz.constructors
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ private fun <T : Any> creatorsFromCompanionObject(clazz: KClass<T>): Set<Pair<KC
6666 companionObject::class .functions
6767 .filter { it.annotations.any { annotation -> annotation is KConverter } }
6868 .map { function ->
69- val func: KFunction <T > = CompanionKFunction (function, companionObject) as KFunction <T >
69+ val func: KFunction <T > = KFunctionWithInstance (function, companionObject) as KFunction <T >
7070
7171 (func.parameters.single().type.classifier as KClass <* >) to func
7272 }.toSet()
You can’t perform that action at this time.
0 commit comments