mcimadamore@27: /* mcimadamore@27: * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. mcimadamore@27: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@27: * mcimadamore@27: * This code is free software; you can redistribute it and/or modify it mcimadamore@27: * under the terms of the GNU General Public License version 2 only, as mcimadamore@27: * published by the Free Software Foundation. mcimadamore@27: * mcimadamore@27: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@27: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@27: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@27: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@27: * accompanied this code). mcimadamore@27: * mcimadamore@27: * You should have received a copy of the GNU General Public License version mcimadamore@27: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@27: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@27: * mcimadamore@27: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, mcimadamore@27: * CA 95054 USA or visit www.sun.com if you need additional information or mcimadamore@27: * have any questions. mcimadamore@27: */ mcimadamore@27: mcimadamore@27: /* mcimadamore@27: * @test mcimadamore@27: * @bug 6450290 mcimadamore@27: * @summary Capture of nested wildcards causes type error mcimadamore@27: * @author Maurizio Cimadamore mcimadamore@27: * @compile/fail T6450290.java mcimadamore@27: */ mcimadamore@27: mcimadamore@27: public class T6450290 { mcimadamore@27: static class Box, T extends X> { mcimadamore@27: T value; mcimadamore@27: Box same; mcimadamore@27: } mcimadamore@27: mcimadamore@27: static class A extends Box {} mcimadamore@27: static class B extends Box {} mcimadamore@27: public static void main(String[] args) { mcimadamore@27: Box b = new Box,Box>(); mcimadamore@27: b.value.same = new Box(); //javac misses this bad assignment mcimadamore@27: } mcimadamore@27: }