Maurizio Cimadamore 884ad14bdf 6360970: javac erroneously accept ambiguous field reference
Clash between ambiguous fields in superinterface and unambiguous field in subinterface is erroneously marked as unambiguous

Reviewed-by: jjg, vromero
2013-06-06 15:30:14 +01:00

26 lines
466 B
Java

/*
* @test /nodynamiccopyright/
* @bug 6360970
* @summary javac erroneously accept ambiguous field reference
* @compile/fail/ref=T6360970.out -XDrawDiagnostics T6360970.java
*/
class T6360970 {
interface A {
int i = 1;
}
interface B {
int i = 2;
}
interface C extends A, B { }
static class D {
public static final int i = 0;
}
static class E extends D implements C { }
int i = E.i; //ambiguous
}