Skip to content

Commit d25b38a

Browse files
gselzerctrueden
authored andcommitted
isSafeAssignable: Find more specific method types
1 parent ccab892 commit d25b38a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/org/scijava/ops/matcher/MatchingUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ public static boolean isSafeAssignable(Type[] destTypes, Map<TypeVariable<?>, Ty
370370

371371
Method[] destMethods = Arrays.stream(Types.raw(dest).getDeclaredMethods())
372372
.filter(method -> Modifier.isAbstract(method.getModifiers())).toArray(Method[]::new);
373-
Type[] params = Types.methodParamTypes(destMethods[0], Types.raw(src));
374-
Type returnType = Types.methodReturnType(destMethods[0], Types.raw(src));
373+
Type[] params = Types.getExactParameterTypes(destMethods[0], src);
374+
Type returnType = Types.getExactReturnType(destMethods[0], src);
375375
for (int i = 0; i < params.length; i++) {
376376
if (!Types.isAssignable(destTypes[i], params[i], typeVarAssigns))
377377
return false;

0 commit comments

Comments
 (0)