2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2014-06-05 10:44:38 -07:00
|
|
|
* @test /nodynamiccopyright/
|
2007-12-01 00:00:00 +00:00
|
|
|
* @bug 6219964
|
|
|
|
* @summary Compiler allows illegal cast of anonymous inner class
|
2014-06-05 10:44:38 -07:00
|
|
|
* @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;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|