Fri, 28 Jan 2011 12:01:07 +0000
6910550: javac 1.5.0_17 fails with incorrect error message
Summary: multiple clashing members declared in same class should be added to the class' scope in order to avoid downstream spurious diagnostics
Reviewed-by: jjg
darcy@609 | 1 | /* |
darcy@609 | 2 | * @test /nodynamiccopyright/ |
darcy@609 | 3 | * @bug 6911256 6964740 |
darcy@609 | 4 | * @author Joseph D. Darcy |
darcy@609 | 5 | * @summary Verify bad TWRs don't compile |
darcy@609 | 6 | * @compile/fail -source 6 BadTwrSyntax.java |
darcy@609 | 7 | * @compile/fail/ref=BadTwrSyntax.out -XDrawDiagnostics BadTwrSyntax.java |
darcy@609 | 8 | */ |
darcy@609 | 9 | |
darcy@609 | 10 | import java.io.IOException; |
darcy@609 | 11 | public class BadTwrSyntax implements AutoCloseable { |
darcy@609 | 12 | public static void main(String... args) throws Exception { |
darcy@609 | 13 | // illegal semicolon ending resources |
darcy@609 | 14 | try(BadTwr twrflow = new BadTwr();) { |
darcy@609 | 15 | System.out.println(twrflow.toString()); |
darcy@609 | 16 | } |
darcy@609 | 17 | } |
darcy@609 | 18 | |
darcy@609 | 19 | public void close() { |
darcy@609 | 20 | ; |
darcy@609 | 21 | } |
darcy@609 | 22 | } |