langtools/test/tools/javac/T8029569/VarargsAmbiguityCrashTest.java
author hannesw
Tue, 22 Mar 2016 14:23:16 +0100
changeset 36690 06b714373aa4
parent 24400 f05df7f58567
permissions -rw-r--r--
8151810: for-in iteration does not provide per-iteration scope Reviewed-by: attila, lagergren
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22161
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
     1
/*
24400
f05df7f58567 8037379: fix for JDK-8029569 doesn't cover all possible cases
vromero
parents: 22161
diff changeset
     2
 * @test /nodynamiccopyright/
f05df7f58567 8037379: fix for JDK-8029569 doesn't cover all possible cases
vromero
parents: 22161
diff changeset
     3
 * @bug 8029569 8037379
22161
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
     4
 * @summary internal javac cast exception when resolving varargs ambiguity
24400
f05df7f58567 8037379: fix for JDK-8029569 doesn't cover all possible cases
vromero
parents: 22161
diff changeset
     5
 * fix for JDK-8029569 doesn't cover all possible cases
22161
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
     6
 * @compile/fail/ref=VarargsAmbiguityCrashTest.out -XDrawDiagnostics VarargsAmbiguityCrashTest.java
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
     7
 */
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
     8
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
     9
public class VarargsAmbiguityCrashTest {
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
    10
    void m1() {
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
    11
        m2(null, new Exception());
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
    12
    }
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
    13
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
    14
    void m2(Long l) {}
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
    15
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
    16
    void m2(Exception... exception) {}
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
    17
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
    18
    void m2(Long l, Exception... exception) {}
d79fb23b5dca 8029569: internal javac cast exception when resolving varargs ambiguity
vromero
parents:
diff changeset
    19
}