langtools/test/tools/javac/lambda/TargetType70.java
author mcimadamore
Mon, 15 Apr 2013 14:16:05 +0100
changeset 16973 8f424142e725
permissions -rw-r--r--
8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82 Summary: Fix bug in Types.removeWildcards Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16973
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
     1
/*
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
     4
 *
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
     8
 *
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    13
 * accompanied this code).
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    14
 *
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    18
 *
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    21
 * questions.
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    22
 */
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    23
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    24
/*
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    25
 * @test
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    26
 * @bug 8011028
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    27
 * @summary lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    28
 * @compile TargetType70.java
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    29
 */
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    30
class TargetType70  {
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    31
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    32
    static class Sup {}
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    33
    static class Sub extends Sup {}
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    34
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    35
    interface I<T extends GenSup<U>, U> {
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    36
        T m(U o);
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    37
    }
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    38
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    39
    static class GenSup<T> {
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    40
        GenSup(T f) { }
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    41
    }
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    42
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    43
    static class GenSub<T> extends GenSup<T> {
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    44
        GenSub(T f) { super(f); }
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    45
    }
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    46
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    47
    <T extends Sup> void m(I<? extends GenSup<T>, T> o1, T o2) { }
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    48
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    49
    void test(Sub sub) {
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    50
        m(GenSub::new, sub);
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    51
    }
8f424142e725 8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
mcimadamore
parents:
diff changeset
    52
}