mcimadamore@30: /* mcimadamore@30: * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. mcimadamore@30: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@30: * mcimadamore@30: * This code is free software; you can redistribute it and/or modify it mcimadamore@30: * under the terms of the GNU General Public License version 2 only, as mcimadamore@30: * published by the Free Software Foundation. mcimadamore@30: * mcimadamore@30: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@30: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@30: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@30: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@30: * accompanied this code). mcimadamore@30: * mcimadamore@30: * You should have received a copy of the GNU General Public License version mcimadamore@30: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@30: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@30: * mcimadamore@30: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, mcimadamore@30: * CA 95054 USA or visit www.sun.com if you need additional information or mcimadamore@30: * have any questions. mcimadamore@30: */ mcimadamore@30: mcimadamore@30: /* mcimadamore@30: * @test mcimadamore@30: * @bug 6559182 mcimadamore@30: * @summary Cast from a raw type with non-generic supertype to a raw type fails unexpectedly mcimadamore@30: * @author Maurizio Cimadamore mcimadamore@30: * mcimadamore@30: * @compile Casting5.java mcimadamore@30: */ mcimadamore@30: mcimadamore@30: class Casting5 { mcimadamore@30: static interface Super

{} mcimadamore@30: static class Y implements Super{} mcimadamore@30: static interface X extends Super{} mcimadamore@30: static class S extends Y {} mcimadamore@30: static interface T extends X {} mcimadamore@30: mcimadamore@30: public static void main(String... args) { mcimadamore@30: S s = null; // same if I use S mcimadamore@30: T t = null; // same if I use T mcimadamore@30: t = (T) s; mcimadamore@30: } mcimadamore@30: }