2389 if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.SPECULATIVE) { |
2389 if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.SPECULATIVE) { |
2390 //check for errors in lambda body |
2390 //check for errors in lambda body |
2391 for (JCDiagnostic deferredDiag : lambdaDeferredHandler.getDiagnostics()) { |
2391 for (JCDiagnostic deferredDiag : lambdaDeferredHandler.getDiagnostics()) { |
2392 if (deferredDiag.getKind() == JCDiagnostic.Kind.ERROR) { |
2392 if (deferredDiag.getKind() == JCDiagnostic.Kind.ERROR) { |
2393 resultInfo.checkContext |
2393 resultInfo.checkContext |
2394 .report(that, diags.fragment("bad.arg.types.in.lambda", TreeInfo.types(that.params))); |
2394 .report(that, diags.fragment("bad.arg.types.in.lambda", TreeInfo.types(that.params), |
|
2395 deferredDiag)); //hidden diag parameter |
2395 //we mark the lambda as erroneous - this is crucial in the recovery step |
2396 //we mark the lambda as erroneous - this is crucial in the recovery step |
2396 //as parameter-dependent type error won't be reported in that stage, |
2397 //as parameter-dependent type error won't be reported in that stage, |
2397 //meaning that a lambda will be deemed erroeneous only if there is |
2398 //meaning that a lambda will be deemed erroeneous only if there is |
2398 //a target-independent error (which will cause method diagnostic |
2399 //a target-independent error (which will cause method diagnostic |
2399 //to be skipped). |
2400 //to be skipped). |