Skip to content

Commit 4d4c361

Browse files
committed
Allow nested TypeVars to be better reified
1 parent 94c893f commit 4d4c361

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/org/scijava/util/Types.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,6 +2245,10 @@ && isAssignable(fromResolved, toResolved, typeVarAssigns))) {
22452245
Type[] fromTypes = ((ParameterizedType) fromResolved).getActualTypeArguments();
22462246
Type[] toTypes = ((ParameterizedType) toResolved).getActualTypeArguments();
22472247
for(int i = 0; i < fromTypes.length; i++) {
2248+
if(toTypes[i] instanceof TypeVariable<?> && Types.isAssignable(fromTypes[i], toTypes[i], typeVarAssigns)) {
2249+
typeVarAssigns.put((TypeVariable<?>) toTypes[i], fromTypes[i]);
2250+
continue;
2251+
}
22482252
if(!(fromTypes[i] instanceof Any || toTypes[i] instanceof Any)) return false;
22492253
}
22502254
continue;

0 commit comments

Comments
 (0)