jdk-24/test/langtools/tools/javac/staticImport/StaticImport2.java

27 lines
397 B
Java
Raw Normal View History

2007-12-01 00:00:00 +00:00
/*
* @test /nodynamiccopyright/
2007-12-01 00:00:00 +00:00
* @bug 4855358
* @summary add support for JSR 201's static import facility
* @author gafter
*
* @compile/fail/ref=StaticImport2.out -XDrawDiagnostics StaticImport2.java
2007-12-01 00:00:00 +00:00
*/
package p;
import static p.A.*;
import static p.B.*;
interface A {
int K = 3;
}
interface B {
int K = 4;
}
class C {
void f() {
int x = K; // ambiguous
}
}