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-824] @noescape for Type Aliased Closures #43436

Closed
swift-ci opened this issue Feb 26, 2016 · 4 comments
Closed

[SR-824] @noescape for Type Aliased Closures #43436

swift-ci opened this issue Feb 26, 2016 · 4 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-824
Radar None
Original Reporter Infinity-James (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Xcode 7.2.1 running on an iMac 5k, 27", Late 2015 - OS X 10.11.3

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: 3f28d2b38975f941ff255bff927e0cb6

relates to:

  • SR-2053 [Regression] Using @NoEscape for a type aliased closure results in a compile error

Issue Description:

If I define a type alias for a closure, for example:

typealias CompletionHandler = (success: Bool) -> ()

and I then use this type in a function:

func doThing(completion: CompletionHandler)

if I want to make this closure @NoEscape like so:

func doThing(@noescape completion: CompletionHandler)

I am presented with the error:

@noescape may only be applied to parameters of function type

@lattner
Copy link
Mannequin

lattner mannequin commented Mar 3, 2016

Fixed here, thanks!
c3c6bea

@0xpablo
Copy link

0xpablo commented Jul 7, 2016

I'm reopening this issue since it is broken again in Swift 3 since now @noescape is now an attribute on the type.
I'm getting this compile error: error: @noescape attribute only applies to function types

Environment: Apple Swift version 3.0 (swiftlang-800.0.33.1 clang-800.0.31) (Xcode 8 beta 2)

cc: @lattner

Thank you guys for your hard work!

@lattner
Copy link
Mannequin

lattner mannequin commented Jul 12, 2016

Please open a new SR, and include a code example that shows the problem.

@0xpablo
Copy link

0xpablo commented Jul 12, 2016

Done, I've opened SR-2053.
Thank you

@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.
Projects
None yet
Development

No branches or pull requests

2 participants