8024207: javac crash in Flow.AssignAnalyzer.visitIdent
Reviewed-by: jjg
This commit is contained in:
parent
204f4422ba
commit
0a312ba2ce
@ -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 ?
|
||||
|
23
langtools/test/tools/javac/T8024207/FlowCrashTest.java
Normal file
23
langtools/test/tools/javac/T8024207/FlowCrashTest.java
Normal 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; })));
|
||||
|
||||
}
|
||||
}
|
2
langtools/test/tools/javac/T8024207/FlowCrashTest.out
Normal file
2
langtools/test/tools/javac/T8024207/FlowCrashTest.out
Normal 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
|
Loading…
x
Reference in New Issue
Block a user