Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
swift-ci opened this issue Sep 18, 2016 · 5 comments
Closed

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

swift-ci opened this issue Sep 18, 2016 · 5 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

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
@swift-ci
Copy link
Collaborator Author

Comment by Jonathan (JIRA)

Any progress on this? It seems like something that should happen based on the way typealias's are defined.

@NachoSoto
Copy link
Contributor

I can't believe this is still unresolved. I filed SR-3824 on February 2017...

@theblixguy
Copy link
Collaborator

PR: #22015

@theblixguy
Copy link
Collaborator

jon889 (JIRA User) @NachoSoto Fixed on master.

@swift-ci
Copy link
Collaborator Author

swift-ci commented May 5, 2019

Comment by Slipp Douglas Thompson (JIRA)

For clarity, looks like this bug is present in Swift 5.0/5.0.1 and fixed as of Swift 5.1.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants