test/tools/javac/generics/inference/6718364/T6718364.java

Fri, 08 Aug 2008 17:38:20 +0100

author
mcimadamore
date
Fri, 08 Aug 2008 17:38:20 +0100
changeset 93
30a415f8667f
child 384
ed31953ca025
permissions
-rw-r--r--

6718364: inference fails when a generic method is invoked with raw arguments
Summary: Bug in the implementation of Types.isSubtypeUnchecked
Reviewed-by: jjg

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

mercurial