Skip to content

Commit 9ee1fb7

Browse files
committed
Fix method matching to ensure parameter count matches before type compatibility check
1 parent f01203f commit 9ee1fb7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/kotlin/org/domaframework/doma/intellij/common/util/MethodMatcher.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ class MethodMatcher {
8181
): PsiMethod? =
8282
methods.firstOrNull { method ->
8383
val methodParams = method.parameterList.parameters
84-
methodParams.zip(actualParameterTypes).all { (definedParam, actualType) ->
85-
areTypesCompatible(definedParam.type, actualType)
86-
}
84+
methodParams.size == actualParameterTypes.size &&
85+
methodParams.zip(actualParameterTypes).all { (definedParam, actualType) ->
86+
areTypesCompatible(definedParam.type, actualType)
87+
}
8788
}
8889

8990
private fun areTypesCompatible(

0 commit comments

Comments
 (0)