Skip to content

[SR-2688] autoclosure does not support closure typealias #45293

@swift-ci

Description

@swift-ci
Previous ID SR-2688
Radar None
Original Reporter paul.eipper (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

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

Additional Detail from JIRA
Votes 6
Component/s Compiler
Labels Bug
Assignee @theblixguy
Priority Medium

md5: 9f37a359be81b189770a77e2934b7c3e

duplicates:

  • SR-3824 Autoclosure attribute fails with type aliased function

Issue 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

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itself

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions