Debian Codegraph @

checker/tests/nullness/generics/MethodTypeVars2.java

raw
1 import org.checkerframework.checker.nullness.qual.*;
2
3 public class MethodTypeVars2 {
4
5 class GeoSegment {}
6
7 interface Path<N1, P1 extends Path<N1, P1>> {}
8
9 private static <N2 extends GeoSegment, P2 extends Path<N2, P2>> @Nullable Object pathToRoute(
10 Path<N2, P2> path) {
11 return null;
12 }
13
14 class StreetSegment extends GeoSegment {}
15
16 class StreetSegmentPath implements Path<StreetSegment, StreetSegmentPath> {}
17
18 void call(StreetSegmentPath p) {
19 Object r = pathToRoute(p);
20 }
21
22 static class WorkingWithOne {
23 interface GPath<P extends GPath<P>> {}
24
25 class GStreetSegmentPath implements GPath<GStreetSegmentPath> {}
26
27 private static <P extends GPath<P>> @Nullable Object pathToRoute(GPath<P> path) {
28 return null;
29 }
30
31 void call(GStreetSegmentPath p) {
32 Object r = pathToRoute(p);
33 }
34 }
35 }