-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementation
Description
| Previous ID | SR-5556 |
| Radar | None |
| Original Reporter | @CodaFi |
| Type | Bug |
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Compiler |
| Labels | Bug, DiagnosticsQoI |
| Assignee | mkchoi212 (JIRA) |
| Priority | Medium |
md5: 4f14ea42d651469b5c1a49e8c94f02a5
is duplicated by:
- SR-5455 Compiler not able to provide automatic fix-it for returning closure
Issue Description:
The following code
func mapping <A, B, C> (f: (A) -> (B)) -> (((C, B) -> (C))) -> ((C, A) -> (C)) {
return { reducer in
return { accum, input in
reducer(accum, f(input))
}
}
}Should suggest that we insert @escaping in two places such that the final signature is
func mapping <A, B, C> (f: @escaping (A) -> (B)) -> (@escaping ((C, B) -> (C))) -> ((C, A) -> (C))However, it only chooses to offer a fixit for the leftmost @escaping and reports the rightmost one as escaping without a fixit. We should diagnose both consistently and offer a fixit.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementation