langtools/test/tools/javac/generics/inference/8055963/T8055963.java
author alundblad
Wed, 26 Aug 2015 09:02:02 +0200
changeset 32337 c9d3ab9f601c
parent 29776 984a79b71cfe
permissions -rw-r--r--
8133671: langtools tests have bad license Summary: Dropped classpath exception from copyright notice in tests. Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26663
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
     1
/*
29776
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents: 26663
diff changeset
     2
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
26663
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
     4
 *
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
32337
c9d3ab9f601c 8133671: langtools tests have bad license
alundblad
parents: 29776
diff changeset
     7
 * published by the Free Software Foundation.
26663
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
     8
 *
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    13
 * accompanied this code).
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    14
 *
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    18
 *
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    21
 * questions.
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    22
 */
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    23
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    24
/**
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    25
 * @test
29776
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents: 26663
diff changeset
    26
 * @bug 8055963 8062373
26663
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    27
 * @summary Inference failure with nested invocation
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    28
 */
29776
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents: 26663
diff changeset
    29
public class T8055963 {
26663
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    30
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    31
    static class C<T> {}
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    32
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    33
    <T> T choose(T first, T second) { return null; }
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    34
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    35
    void test() {
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    36
        C<String> cs = choose(new C<String>(), new C<>());
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    37
    }
29776
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents: 26663
diff changeset
    38
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents: 26663
diff changeset
    39
    public static void main(String [] args) {
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents: 26663
diff changeset
    40
      new T8055963().test();
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents: 26663
diff changeset
    41
    }
26663
f2d8845a9bb2 8055963: Inference failure with nested invocation
mcimadamore
parents:
diff changeset
    42
}