File: T8170410.java

package info (click to toggle)
libnb-javaparser-java 9%2B2018-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 65,172 kB
  • sloc: java: 440,096; xml: 6,359; sh: 865; makefile: 314
file content (23 lines) | stat: -rw-r--r-- 517 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * @test
 * @bug 8170410
 * @summary inference: javac doesn't implement 18.2.5 correctly
 * @compile T8170410.java
 */

class T8170410 {
    interface CheckedSupplier<T extends Throwable, R> {
        R get() throws T;
    }

    static <T extends Throwable, R> CheckedSupplier<T, R> checked(CheckedSupplier<T, R> checkedSupplier) {
        return checkedSupplier;
    }

    static void test() {
        checked(() -> null).get();
        checked(T8170410::m).get();
    }

    static String m() { return ""; }
}