18 lines
365 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 6219964
* @summary Compiler allows illegal cast of anonymous inner class
* @compile/fail/ref=T6219964.out -XDrawDiagnostics T6219964.java
2007-12-01 00:00:00 +00:00
*/
public class T6219964 {
interface I { }
void foo() {
new Object() {
I bar() {
return (I)this;
}
};
}
}