mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SR-14824] Improve diagnostic for multi-statement closures instead of saying "too complex closure return type"
This commit is contained in:
@@ -6845,8 +6845,7 @@ bool UnableToInferClosureParameterType::diagnoseAsError() {
|
||||
bool UnableToInferClosureReturnType::diagnoseAsError() {
|
||||
auto *closure = castToExpr<ClosureExpr>(getRawAnchor());
|
||||
|
||||
auto diagnostic = emitDiagnostic(diag::cannot_infer_closure_result_type,
|
||||
closure->hasSingleExpressionBody());
|
||||
auto diagnostic = emitDiagnostic(diag::cannot_infer_closure_result_type);
|
||||
|
||||
// If there is a location for an 'in' token, then the argument list was
|
||||
// specified somehow but no return type was. Insert a "-> ReturnType "
|
||||
|
||||
Reference in New Issue
Block a user