File: Issue1377.java

package info (click to toggle)
checker-framework-java 3.2.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 22,840 kB
  • sloc: java: 145,910; xml: 839; sh: 518; makefile: 401; perl: 26
file content (24 lines) | stat: -rw-r--r-- 547 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Test case for Issue 1377.
// https://github.com/typetools/checker-framework/issues/1377

interface Func1377<P, R> {
    R apply(P p);
}

@SuppressWarnings("") // just check for crashes
interface Issue1377<V> {
    static <U> Issue1377<U> of(Issue1377<U> in) {
        return in;
    }

    <S> Issue1377<S> m1(Func1377<? super V, S> f);

    <T> Issue1377<T> m2(Func1377<V, T> f);
}

@SuppressWarnings("") // just check for crashes
class Crash1377 {
    void foo(Issue1377<Void> p) {
        Issue1377.of(p.m1(in -> p)).m2(empty -> 5);
    }
}