6663588: Compiler goes into infinite loop for Cyclic Inheritance test case

Interplay between cyclic inheritance and tvar bounds hangs javac

Reviewed-by: jjg
This commit is contained in:
Maurizio Cimadamore 2008-03-04 15:45:20 +00:00
parent 6350088352
commit e82f625583
2 changed files with 36 additions and 2 deletions

View File

@ -901,10 +901,10 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
c.flags_field |= DEPRECATED;
annotateLater(tree.mods.annotations, baseEnv, c);
attr.attribTypeVariables(tree.typarams, baseEnv);
chk.checkNonCyclic(tree.pos(), c.type);
attr.attribTypeVariables(tree.typarams, baseEnv);
// Add default constructor if needed.
if ((c.flags() & INTERFACE) == 0 &&
!TreeInfo.hasConstructors(tree.defs)) {

View File

@ -0,0 +1,34 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6663588
* @summary Compiler goes into infinite loop for Cyclic Inheritance test case
* @author Maurizio Cimadamore
* @compile/fail T6663588.java
*/
public class T6663588<T extends T6663588.Inner> extends T6663588 {
class Inner extends T6663588.Inner {}
}