Skip to content

Commit

Permalink
Fix issue 2065 Problem resolving type of lambda with Math method invo…
Browse files Browse the repository at this point in the history
…cation inside
  • Loading branch information
jlerbsc committed Nov 26, 2020
1 parent b39f958 commit 14aa2d0
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ private static boolean isApplicable(ResolvedMethodDeclaration methodDeclaration,
needForWildCardTolerance = true;
continue;
}
// if the expected is java.lang.Math.max(double,double) and the type parameters are defined with constrain
// for example LambdaConstraintType{bound=TypeVariable {ReflectionTypeParameter{typeVariable=T}}}, LambdaConstraintType{bound=TypeVariable {ReflectionTypeParameter{typeVariable=U}}}
// we want to keep this method for future resolution
if (actualArgumentType.isConstraint() && withWildcardTolerance && expectedDeclaredType.isPrimitive()) {
needForWildCardTolerance = true;
continue;
}
if (methodIsDeclaredWithVariadicParameter && i == countOfMethodParametersDeclared - 1) {
if (new ResolvedArrayType(expectedDeclaredType).isAssignableBy(actualArgumentType)) {
continue;
Expand Down

0 comments on commit 14aa2d0

Please sign in to comment.