Uploaded image for project: 'Swift'
  1. Swift
  2. SR-5556

@escaping Diagnostics Should Always Offer a Fixit

    XMLWordPrintable

    Details

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mkchoi212 Mike Choi
                Reporter:
                rwidmann Robert Widmann
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: