Debian Codegraph @

framework/tests/all-systems/Issue759.java

raw
1 // Testcase for Issue759
2 // https://github.com/typetools/checker-framework/issues/759
3 @SuppressWarnings({"nullness", "unchecked"}) // See checker/test/nullness/Issue759.java
4 public class Issue759 {
5 void possibleValues(final Class<? extends Enum> enumType) {
6 lowercase(enumType.getEnumConstants());
7 lowercase2(enumType.getEnumConstants());
8 lowercase3(enumType.getEnumConstants());
9 }
10
11 <T extends Enum<T>> void lowercase(final T... items) {}
12
13 <T extends Enum<T>> void lowercase2(final T[] items) {}
14
15 <T> void lowercase3(final T items) {}
16 }
17
18 @SuppressWarnings("nullness")
19 class Gen<T extends Gen<T>> {
20 T[] getConstants() {
21 return null;
22 }
23 }
24
25 @SuppressWarnings("nullness")
26 class IncompatibleTypes {
27 void possibleValues(final Gen<?> genType) {
28 lowercase(genType.getConstants());
29 }
30
31 <S> void lowercase(final S items) {}
32 }