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

Commit 3db4c67

Browse files
committed
classからの宣言を追加
1 parent 02d88d1 commit 3db4c67

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.mapk.core.ArgumentBucket
66
import com.mapk.core.KFunctionForCall
77
import com.mapk.core.getAliasOrName
88
import com.mapk.core.isUseDefaultArgument
9+
import com.mapk.core.toKConstructor
910
import java.lang.IllegalArgumentException
1011
import kotlin.reflect.KClass
1112
import kotlin.reflect.KFunction
@@ -16,7 +17,7 @@ import kotlin.reflect.full.findAnnotation
1617
import kotlin.reflect.full.memberProperties
1718
import kotlin.reflect.jvm.jvmName
1819

19-
class BoundKMapper<S : Any, D> private constructor(
20+
class BoundKMapper<S : Any, D : Any> private constructor(
2021
private val function: KFunctionForCall<D>,
2122
src: KClass<S>,
2223
parameterNameConverter: (String) -> String = { it }
@@ -25,6 +26,10 @@ class BoundKMapper<S : Any, D> private constructor(
2526
KFunctionForCall(function), src, parameterNameConverter
2627
)
2728

29+
constructor(clazz: KClass<D>, src: KClass<S>, parameterNameConverter: (String) -> String = { it }) : this(
30+
clazz.toKConstructor(), src, parameterNameConverter
31+
)
32+
2833
private val parameters: List<BoundParameterForMap<S>>
2934

3035
init {

0 commit comments

Comments
 (0)