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

Add fix-it for removing '@escaping' from optional closure parameter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Compiler
    • Labels:
    • Environment:

      Xcode 8.3.1, Swift 3.1

      Description

      As of SR-2444, optional closures as function parameters are already escaping escaping by default. Currently, when adding the @escaping attribute to an optional closure parameter, the compiler throws the following error:

      @escaping attribute only applies to function types
      

      Since this type is already escaping escaping by default, it would be helpful to add / amend the error as follows:

      Optional closures are already @escaping.
      

      And add the following Fix-it:

      Fix-it Delete "@escaping"
      

        Attachments

          Activity

            People

            Assignee:
            ismetanin Ivan Smetanin
            Reporter:
            garricn Garric Nahapetian
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: