test/tools/javac/generics/typevars/6569404/T6569404b.java

Tue, 11 Aug 2009 01:14:06 +0100

author
mcimadamore
date
Tue, 11 Aug 2009 01:14:06 +0100
changeset 361
13902c0c9b83
child 384
ed31953ca025
permissions
-rw-r--r--

6569404: Cannot instantiate an inner class of a type variable
Summary: javac is too strict in rejecting member selction from a type-var
Reviewed-by: jjg

mcimadamore@361 1 /*
mcimadamore@361 2 * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
mcimadamore@361 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mcimadamore@361 4 *
mcimadamore@361 5 * This code is free software; you can redistribute it and/or modify it
mcimadamore@361 6 * under the terms of the GNU General Public License version 2 only, as
mcimadamore@361 7 * published by the Free Software Foundation.
mcimadamore@361 8 *
mcimadamore@361 9 * This code is distributed in the hope that it will be useful, but WITHOUT
mcimadamore@361 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mcimadamore@361 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mcimadamore@361 12 * version 2 for more details (a copy is included in the LICENSE file that
mcimadamore@361 13 * accompanied this code).
mcimadamore@361 14 *
mcimadamore@361 15 * You should have received a copy of the GNU General Public License version
mcimadamore@361 16 * 2 along with this work; if not, write to the Free Software Foundation,
mcimadamore@361 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mcimadamore@361 18 *
mcimadamore@361 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
mcimadamore@361 20 * CA 95054 USA or visit www.sun.com if you need additional information or
mcimadamore@361 21 * have any questions.
mcimadamore@361 22 */
mcimadamore@361 23
mcimadamore@361 24 /*
mcimadamore@361 25 * @test
mcimadamore@361 26 * @bug 6569404
mcimadamore@361 27 * @summary Regression: Cannot instantiate an inner class of a type variable
mcimadamore@361 28 * @author mcimadamore
mcimadamore@361 29 * @compile/fail/ref=T6569404b.out T6569404b.java -XDrawDiagnostics
mcimadamore@361 30 */
mcimadamore@361 31
mcimadamore@361 32 class T6569404b {
mcimadamore@361 33
mcimadamore@361 34 static class A<X> {}
mcimadamore@361 35
mcimadamore@361 36 static class B<T extends Outer> extends A<T.Inner> {}
mcimadamore@361 37
mcimadamore@361 38 static class Outer {
mcimadamore@361 39 public class Inner {}
mcimadamore@361 40 }
mcimadamore@361 41 }

mercurial