Skip to content

Commit

Permalink
Fix deannotation of wildcard types
Browse files Browse the repository at this point in the history
Previously type annotations were being preserved on the upper and lower bounds of wildcard types.

PiperOrigin-RevId: 599910757
  • Loading branch information
cushon authored and Javac Team committed Jan 19, 2024
1 parent d3b0c98 commit 62d9e65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions java/com/google/turbine/types/Deannotate.java
Expand Up @@ -68,9 +68,9 @@ private static Type deannotateWildTy(Type.WildTy ty) {
case NONE:
return Type.WildUnboundedTy.create(ImmutableList.of());
case LOWER:
return Type.WildLowerBoundedTy.create(ty.bound(), ImmutableList.of());
return Type.WildLowerBoundedTy.create(deannotate(ty.bound()), ImmutableList.of());
case UPPER:
return Type.WildUpperBoundedTy.create(ty.bound(), ImmutableList.of());
return Type.WildUpperBoundedTy.create(deannotate(ty.bound()), ImmutableList.of());
}
throw new AssertionError(ty.boundKind());
}
Expand Down
Expand Up @@ -244,6 +244,8 @@ protected static TypeParameters typeParameters() throws Exception {
annotatedTypes.add("@A List");
annotatedTypes.add("@A List<@A int @B []>");
annotatedTypes.add("Map.@A Entry<@B Integer, @C Number>");
annotatedTypes.add("@A List<@B ? extends @C String>");
annotatedTypes.add("@A List<@B ? super @C String>");
}

List<String> files = new ArrayList<>();
Expand Down

0 comments on commit 62d9e65

Please sign in to comment.