Skip to content

Commit

Permalink
Reduce scope of workaround; fixes #6116
Browse files Browse the repository at this point in the history
  • Loading branch information
smillst authored Aug 10, 2023
1 parent 65b1d6f commit 600920f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions checker/tests/tainting/Issue6116.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import java.util.Iterator;
import java.util.function.Consumer;

class Issue6116<T> {
private final Iterator<? extends T> it;

public Issue6116(Iterator<? extends T> iterator) {
this.it = iterator;
}

public void test(Consumer<? super T> action) {
it.forEachRemaining(action);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,10 @@ public Boolean visitTypevar_Typevar(
// This should be removed when 979 is fixed.
// This case happens when the captured type variables should be the same type, but
// aren't because type argument inference isn't implemented correctly.
return isContainedWithinBounds(
subtype, supertype.getLowerBound(), supertype.getUpperBound(), false);
if (isContainedWithinBounds(
subtype, supertype.getLowerBound(), supertype.getUpperBound(), false)) {
return true;
}
}

if (supertype.getLowerBound().getKind() != TypeKind.NULL) {
Expand Down

0 comments on commit 600920f

Please sign in to comment.