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

Incorrect fix-it for misplaced @noescape

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Invalid
    • Component/s: Compiler
    • Labels:

      Description

      In recent gtihub swift, the fixit for a misplaced @noescape is incorrect.

      % cat test.swift
      func f(g: @noescape ()->Void) {
      g()
      }

      % xcrun swiftc test.swift
      test.swift:1:12: error: attribute can only be applied to declarations, not types
      func f(g: @noescape ()->Void) {
      ^~~~~~~~
      @noescape

      This fixit moves @noescape to the function attribute position, which is incorrect. @noescape should be applied to the parameter (i.e. before `g`).

        Attachments

          Activity

            People

            Assignee:
            jgarnham Josh Garnham
            Reporter:
            gparker Greg Parker
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: