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

Autoclosure attribute fails with type aliased function

    XMLWordPrintable

    Details

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

      Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)

      Description

      class C {
          typealias X = () -> Void
      
          // error: @autoclosure attribute only applies to function types
          func f1(x: @autoclosure @escaping X) {}
      
          // works
          func f2(x: @autoclosure @escaping () -> Void) {}
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              NachoSoto Nacho Soto
              Reporter:
              NachoSoto Nacho Soto
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: