langtools/test/tools/javac/generics/inference/6638712/T6638712a.java
author mcimadamore
Tue, 23 Nov 2010 11:08:43 +0000
changeset 7331 02ffc087c654
parent 3766 7e2df99e9223
permissions -rw-r--r--
6995200: JDK 7 compiler crashes when type-variable is inferred from expected primitive type Summary: 15.12.2.8 should use boxing when expected type in assignment context is a primitive type Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3140
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
     1
/*
3766
7e2df99e9223 6875336: some tests should use /nodynamiccopyright/
jjg
parents: 3140
diff changeset
     2
 * @test /nodynamiccopyright/
3140
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
     3
 * @bug     6638712
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
     4
 * @author  mcimadamore
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
     5
 * @summary Inference with wildcard types causes selection of inapplicable method
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=T6638712a.out -XDrawDiagnostics T6638712a.java
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
     7
 */
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
     8
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
     9
import java.util.*;
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
    10
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
    11
class T6638712a {
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
    12
7331
02ffc087c654 6995200: JDK 7 compiler crashes when type-variable is inferred from expected primitive type
mcimadamore
parents: 3766
diff changeset
    13
    <T> Comparator<T> compound(Iterable<? extends Comparator<? super T>> it) { return null; }
3140
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
    14
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
    15
    public void test(List<Comparator<?>> x) {
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
    16
        Comparator<String> c3 = compound(x);
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
    17
    }
15a274b13051 6638712: Inference with wildcard types causes selection of inapplicable method
mcimadamore
parents:
diff changeset
    18
}