/
githubmirror
/
panama-vector
Обзор
Документация
Войти
/
githubmirror
/
panama-vector
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/langtools/tools/javac/lambda/8202372/T8202372.java
45 строк
1 KB
Bernard Blaser
8202372: Diagnostic with incorrect line info generated when compiling lambda expression
02 май 2018, 17:29
02 май 2018, 17:29
7dc011c
Код
Авторство
О чём код?
/* * @test /nodynamiccopyright/ * @bug 8202372 * @summary Diagnostic with incorrect line info generated when compiling lambda expression * @compile/fail/ref=T8202372.out -XDrawDiagnostics T8202372.java */ class T8202372 { interface NonVoidFunc { String m(); } interface VoidFunc { void m(); } interface ParamFunc { void m(String s); } public void addVoid(VoidFunc v) {} public void addNonVoid(NonVoidFunc nv) {} public void addParam(ParamFunc p) {} void testVoid(T8202372 test) { test.addVoid(() -> ""); test.addVoid(() -> { return ""; }); test.addVoid(() -> { }); test.addVoid(() -> { return; }); } void testNonVoid(T8202372 test) { test.addNonVoid(() -> ""); test.addNonVoid(() -> { return ""; }); test.addNonVoid(() -> { }); test.addNonVoid(() -> { return; }); } void testParam(T8202372 test) { test.addParam(() -> {}); test.addParam((String x) -> { }); test.addParam((String x1, String x2) -> { }); test.addParam((int x) -> { }); } }