langtools/test/tools/javac/cast/6548436/T6548436a.java
author mcimadamore
Thu, 23 Oct 2008 18:10:23 +0100
changeset 1530 0cb573a51f92
child 5520 86e4b9a9da40
permissions -rw-r--r--
6548436: Incorrect inconvertible types error Summary: Types.rewrite quantifiers should cope with captured type-variables properly Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1530
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
     1
/*
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
     2
 * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
     4
 *
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
     7
 * published by the Free Software Foundation.
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
     8
 *
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    13
 * accompanied this code).
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    14
 *
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    18
 *
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    21
 * have any questions.
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    22
 */
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    23
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    24
/*
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    25
 * @test
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    26
 * @bug 6548436
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    27
 * @summary Incorrect inconvertible types error
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    28
 * @author Maurizio Cimadamore
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    29
 *
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    30
 * @compile T6548436a.java
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    31
 */
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    32
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    33
public class T6548436a {
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    34
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    35
    static class Base<E extends Comparable<E>> {}
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    36
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    37
    static void test(Base<?> je) {
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    38
        Object o = (Base<Integer>)je;
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    39
    }
0cb573a51f92 6548436: Incorrect inconvertible types error
mcimadamore
parents:
diff changeset
    40
}