Skip to content

Commit

Permalink
Convert typevars to "uses" before substitution; fixes #5245
Browse files Browse the repository at this point in the history
  • Loading branch information
smillst committed Sep 30, 2022
1 parent 8e97003 commit 1af86bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions checker/tests/nullness/Issue5245.java
@@ -1,11 +1,9 @@
// Test case for https://github.com/typetools/checker-framework/issues/5245

// @skip-test until the bug is fixed

// @below-java9-jdk-skip-test
import java.util.List;

class CFRepro<E> {
final CFRepro<List<String>> repro = new CFRepro<>(List.of());
class Issue5245<E> {
final Issue5245<List<String>> repro = new Issue5245<>(List.of());

<V extends E> CFRepro(V unknownObj) {}
<V extends E> Issue5245(V unknownObj) {}
}
Expand Up @@ -562,7 +562,7 @@ private static void addTypeVarMappings(
}

for (int i = 0; i < ownerParams.size(); ++i) {
mappings.put(ownerParams.get(i).getUnderlyingType(), baseParams.get(i));
mappings.put(ownerParams.get(i).getUnderlyingType(), baseParams.get(i).asUse());
}
}

Expand Down

0 comments on commit 1af86bf

Please sign in to comment.