jdk-24/langtools/test/tools/javac/diags/DiagnosticRewriterTest2.java
Srikanth Adayapalam 63f6ba5960 8145466: javac: No line numbers in compilation error
Compiler should not use the syntax tree from enclosing contexts in diagnostics even when the enclosing contexts are consulted for method lookup.

Reviewed-by: mcimadamore
2015-12-22 16:37:52 +05:30

23 lines
443 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8145466
* @summary javac: No line numbers in compilation error
* @compile/fail/ref=DiagnosticRewriterTest2.out -Xdiags:compact -XDrawDiagnostics DiagnosticRewriterTest2.java
*/
class DiagnosticRewriterTest2 {
class Bar {
Bar(Object o) { }
}
void test() {
new Bar(null) {
void g() {
m(2L);
m();
}
};
}
void m(int i) { }
}