Skip to content

Commit

Permalink
Don't ignore type arguments (Fixes #3443.) (#3456)
Browse files Browse the repository at this point in the history
  • Loading branch information
smillst authored Jul 20, 2020
1 parent dbb8241 commit fed0216
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 19 additions & 0 deletions checker/tests/nullness/Issue3443.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import org.checkerframework.checker.nullness.qual.Nullable;

class Issue3443 {
static <T extends Supplier3443<@Nullable String>> Supplier3443<String> passThrough(T t) {
// :: error: (return.type.incompatible)
return t;
}

public static void main(String[] args) {
Supplier3443<@Nullable String> s1 = () -> null;
// TODO: passThrough(s1) should cause an error. #979.
Supplier3443<String> s2 = passThrough(s1);
s2.get().toString();
}
}

interface Supplier3443<T> {
T get();
}
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,6 @@ && isPrimarySubtype(ub, supertype)) {
}
return false;
}
return isPrimarySubtype(upperBound, supertype);
}
return checkAndSubtype(upperBound, supertype);
}
Expand Down

0 comments on commit fed0216

Please sign in to comment.