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