Fri, 24 Oct 2008 12:45:47 +0100
6680106: StackOverFlowError for Cyclic inheritance in TypeParameters with ArrayType Bounds
Summary: Javac ends up in an infinite loop while attributing mutually referring array type-parameter bounds
Reviewed-by: jjg
mcimadamore@159 | 1 | /* |
mcimadamore@159 | 2 | * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. |
mcimadamore@159 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
mcimadamore@159 | 4 | * |
mcimadamore@159 | 5 | * This code is free software; you can redistribute it and/or modify it |
mcimadamore@159 | 6 | * under the terms of the GNU General Public License version 2 only, as |
mcimadamore@159 | 7 | * published by the Free Software Foundation. |
mcimadamore@159 | 8 | * |
mcimadamore@159 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
mcimadamore@159 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
mcimadamore@159 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
mcimadamore@159 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
mcimadamore@159 | 13 | * accompanied this code). |
mcimadamore@159 | 14 | * |
mcimadamore@159 | 15 | * You should have received a copy of the GNU General Public License version |
mcimadamore@159 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
mcimadamore@159 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
mcimadamore@159 | 18 | * |
mcimadamore@159 | 19 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
mcimadamore@159 | 20 | * CA 95054 USA or visit www.sun.com if you need additional information or |
mcimadamore@159 | 21 | * have any questions. |
mcimadamore@159 | 22 | */ |
mcimadamore@159 | 23 | |
mcimadamore@159 | 24 | /* |
mcimadamore@159 | 25 | * @test |
mcimadamore@159 | 26 | * @bug 6680106 |
mcimadamore@159 | 27 | * @summary StackOverFlowError for Cyclic inheritance in TypeParameters with ArrayType Bounds |
mcimadamore@159 | 28 | * @author Maurizio Cimadamore |
mcimadamore@159 | 29 | * @compile/fail/ref=T6680106.out -XDrawDiagnostics T6680106.java |
mcimadamore@159 | 30 | */ |
mcimadamore@159 | 31 | |
mcimadamore@159 | 32 | class T6680106 { |
mcimadamore@159 | 33 | class A0 {} |
mcimadamore@159 | 34 | class A1<T extends T[]> {} |
mcimadamore@159 | 35 | class A2<T extends S[], S extends T[]> {} |
mcimadamore@159 | 36 | class A3<T extends S[], S extends U[], U extends T[]> {} |
mcimadamore@159 | 37 | class A5<T extends A0 & T[]> {} |
mcimadamore@159 | 38 | class A6<T extends A0 & S[], S extends A0 & T[]> {} |
mcimadamore@159 | 39 | class A7<T extends A0 & S[], S extends A0 & U[], U extends A0 & T[]> {} |
mcimadamore@159 | 40 | } |