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

Commit f618c1b

Browse files
committed
Valueパラメータ以外が2つで渡された場合に落ちるようにバリデーションを修正
1 parent 72c8a6a commit f618c1b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/kotlin/com/mapk/fastkfunction/SingleArgFastKFunction.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ sealed class SingleArgFastKFunction<T> {
6464

6565
if (!(this.size == 1 || (this.size == 2 && requireInstanceParameter)))
6666
throw IllegalArgumentException("This function is require multiple arguments.")
67+
68+
if (this.size == 2 && this[1].kind != KParameter.Kind.VALUE)
69+
throw IllegalArgumentException("This function is require multiple instances.")
6770
}
6871

6972
private fun <T> topLevelFunctionOf(

0 commit comments

Comments
 (0)