Thu, 25 Jul 2013 14:51:40 +0100
8020843: javac crashes on accessibility check with method reference with typevar receiver
Summary: method reference overload check doesn't walk through type-variable receivers
Reviewed-by: jjg
duke@1 | 1 | /* |
duke@1 | 2 | * @test /nodynamiccopyright/ |
duke@1 | 3 | * @bug 6241723 |
duke@1 | 4 | * @summary compiler can miss some references to at-Deprecated classes |
jjg@611 | 5 | * @compile/fail/ref=T6241723.out -XDrawDiagnostics -Xlint:deprecation -Werror T6241723.java |
duke@1 | 6 | */ |
duke@1 | 7 | |
duke@1 | 8 | @Deprecated class A1 |
duke@1 | 9 | { |
duke@1 | 10 | } |
duke@1 | 11 | |
duke@1 | 12 | class A2 |
duke@1 | 13 | { |
duke@1 | 14 | @Deprecated |
duke@1 | 15 | static class A21 { } |
duke@1 | 16 | } |
duke@1 | 17 | |
duke@1 | 18 | |
duke@1 | 19 | public class T6241723 { |
duke@1 | 20 | // references to earlier classes |
duke@1 | 21 | A1 a1; // warning |
duke@1 | 22 | A2 a2; // OK |
duke@1 | 23 | A2.A21 a21; // warning |
duke@1 | 24 | |
duke@1 | 25 | // forward references to classes not yet seen |
duke@1 | 26 | Z1 z1; // warning |
duke@1 | 27 | Z2 z2; // OK |
duke@1 | 28 | Z2.Z21 z21; // warning |
duke@1 | 29 | } |
duke@1 | 30 | |
duke@1 | 31 | |
duke@1 | 32 | |
duke@1 | 33 | @Deprecated class Z1 |
duke@1 | 34 | { |
duke@1 | 35 | } |
duke@1 | 36 | |
duke@1 | 37 | class Z2 |
duke@1 | 38 | { |
duke@1 | 39 | @Deprecated |
duke@1 | 40 | static class Z21 { } |
duke@1 | 41 | } |