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

autoclosure does not support closure typealias

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • 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:
                Unassigned
                Reporter:
                paul.eipper Paul Eipper
              • Votes:
                5 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: