8024207: javac crash in Flow.AssignAnalyzer.visitIdent

Reviewed-by: jjg
This commit is contained in:
Vicente Romero 2013-09-14 15:23:21 +01:00
parent 204f4422ba
commit 0a312ba2ce
3 changed files with 26 additions and 1 deletions

View File

@ -2546,7 +2546,7 @@ public class Resolve {
@Override
Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
if (sym.kind >= AMBIGUOUS) {
if (sym.kind == HIDDEN) {
if (sym.kind != WRONG_MTH && sym.kind != WRONG_MTHS) {
sym = super.access(env, pos, location, sym);
} else {
final JCDiagnostic details = sym.kind == WRONG_MTH ?

View File

@ -0,0 +1,23 @@
/*
* @test /nodynamiccopyright/
* @bug 8024207
* @summary javac crash in Flow$AssignAnalyzer.visitIdent
* @compile/fail/ref=FlowCrashTest.out -XDrawDiagnostics FlowCrashTest.java
*/
import java.util.*;
import java.util.stream.*;
public class FlowCrashTest {
static class ViewId { }
public void crash() {
Map<ViewId,String> viewToProfile = null;
new TreeMap<>(viewToProfile.entrySet().stream()
.collect(Collectors.toMap((vid, prn) -> prn,
(vid, prn) -> Arrays.asList(vid),
(a, b) -> { a.addAll(b); return a; })));
}
}

View File

@ -0,0 +1,2 @@
FlowCrashTest.java:18:42: compiler.err.cant.apply.symbols: kindname.method, toMap, @475,@542,@624,{(compiler.misc.inapplicable.method: kindname.method, java.util.stream.Collectors, <T,K,U>toMap(java.util.function.Function<? super T,? extends K>,java.util.function.Function<? super T,? extends U>), (compiler.misc.infer.arg.length.mismatch: T,K,U)),(compiler.misc.inapplicable.method: kindname.method, java.util.stream.Collectors, <T,K,U>toMap(java.util.function.Function<? super T,? extends K>,java.util.function.Function<? super T,? extends U>,java.util.function.BinaryOperator<U>), (compiler.misc.infer.no.conforming.assignment.exists: T,K,U, (compiler.misc.incompatible.arg.types.in.lambda))),(compiler.misc.inapplicable.method: kindname.method, java.util.stream.Collectors, <T,K,U,M>toMap(java.util.function.Function<? super T,? extends K>,java.util.function.Function<? super T,? extends U>,java.util.function.BinaryOperator<U>,java.util.function.Supplier<M>), (compiler.misc.infer.arg.length.mismatch: T,K,U,M))}
1 error