Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit 9d5f188

Browse files
committed
共通化対応
1 parent c69c967 commit 9d5f188

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/kotlin/com/mapk/kmapper/ParameterUtils.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.mapk.core.KFunctionWithInstance
66
import com.mapk.core.ValueParameter
77
import com.mapk.core.getAnnotatedFunctions
88
import com.mapk.core.getAnnotatedFunctionsFromCompanionObject
9+
import com.mapk.core.getKClass
910
import kotlin.reflect.KClass
1011
import kotlin.reflect.KFunction
1112
import kotlin.reflect.full.findAnnotation
@@ -22,7 +23,7 @@ private fun <T> Collection<KFunction<T>>.getConvertersFromFunctions(): Set<Pair<
2223
.map { func ->
2324
func.isAccessible = true
2425

25-
(func.parameters.single().type.classifier as KClass<*>) to func
26+
func.parameters.single().getKClass() to func
2627
}.toSet()
2728
}
2829

@@ -43,7 +44,7 @@ private fun <T : Any> convertersFromCompanionObject(clazz: KClass<T>): Set<Pair<
4344
functions.map { function ->
4445
val func: KFunction<T> = KFunctionWithInstance(function, instance) as KFunction<T>
4546

46-
(func.parameters.single().type.classifier as KClass<*>) to func
47+
func.parameters.single().getKClass() to func
4748
}.toSet()
4849
} ?: emptySet()
4950
}

0 commit comments

Comments
 (0)