Skip to content

Commit

Permalink
Another fix for TypeUtils#isAssignable()
Browse files Browse the repository at this point in the history
A type like `List<? extends String>` is not assignable to e.g. `List<String>` (without cast).
  • Loading branch information
knutwannheden committed Nov 11, 2023
1 parent bdaaa25 commit eb9cdda
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public static boolean isAssignableTo(@Nullable JavaType to, @Nullable JavaType f
return true;
}
}
return isAssignableTo(toFq.getFullyQualifiedName(), from);
return !(from instanceof JavaType.GenericTypeVariable) && isAssignableTo(toFq.getFullyQualifiedName(), from);
} else if (to instanceof JavaType.GenericTypeVariable) {
JavaType.GenericTypeVariable toGeneric = (JavaType.GenericTypeVariable) to;
List<JavaType> toBounds = toGeneric.getBounds();
Expand Down

0 comments on commit eb9cdda

Please sign in to comment.