Maurizio Cimadamore e8d1ae243d 7005095: Cast: compile reject sensible cast from final class to interface
A previous fix to cast conversion has made the compiler too strict w.r.t. final cast

Reviewed-by: jjg
2010-12-09 15:50:10 +00:00

15 lines
370 B
Java

/*
* @test /nodynamiccopyright/
* @bug 7005095
* @summary Cast: compile reject sensible cast from final class to interface
* @compile/fail/ref=T7005095neg.out -XDrawDiagnostics T7005095neg.java
*/
class T7005095pos<T extends Integer> {
interface Foo<T> {}
static final class FooImpl implements Foo<String> {}
Object o = (Foo<T>) new FooImpl();
}