7dc011ccca
Add tree position to speculative lambda tree Reviewed-by: vromero, jlahoda
45 lines
1.1 KiB
Java
45 lines
1.1 KiB
Java
/*
|
|
* @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) -> { });
|
|
}
|
|
} |