This repository was archived by the owner on Jan 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/main/kotlin/com/mapk/core Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ import kotlin.reflect.KClass
1111import kotlin.reflect.KFunction
1212import kotlin.reflect.KParameter
1313import kotlin.reflect.full.companionObjectInstance
14+ import kotlin.reflect.full.findAnnotation
1415import kotlin.reflect.full.functions
1516import kotlin.reflect.full.primaryConstructor
1617import kotlin.reflect.jvm.isAccessible
1718import org.jetbrains.annotations.TestOnly
18- import kotlin.reflect.full.findAnnotation
1919
2020class KFunctionForCall <T > internal constructor(
2121 @TestOnly
@@ -62,7 +62,15 @@ class KFunctionForCall<T> internal constructor(
6262 }
6363 acc
6464 }
65- requiredParametersMap = requiredParameters.associateBy { it.name }
65+
66+ requiredParametersMap = HashMap <String , ValueParameter <* >>().apply {
67+ requiredParameters.forEach {
68+ if (containsKey(it.name))
69+ throw IllegalArgumentException (" The argument name ${it.name} is duplicated." )
70+
71+ this [it.name] = it
72+ }
73+ }
6674 }
6775
6876 fun getArgumentAdaptor (): ArgumentAdaptor = ArgumentAdaptor (requiredParametersMap)
You can’t perform that action at this time.
0 commit comments