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

autoclosure does not support closure typealias

    XMLWordPrintable

    Details

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

      Xcode 8 (8A218a)
      Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
      Build Target iOS SDK 10

      Description

      This will not work in Swift 3:

      typealias ViewClosure = () -> UIView
      
      class ViewController: UIViewController {
      
          func viewMaker(closure: @autoclosure ViewClosure) {
              self.view = closure()
          }
      
      }
      

      Error:

      @autoclosure ViewClosure: @autoclosure attribute only applies to function types
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              suyashsrijan Suyash Srijan
              Reporter:
              paul.eipper Paul Eipper
              Votes:
              6 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: