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-2053] [Regression] Using @noescape for a type aliased closure results in a compile error #44662

0xpablo opened this issue Jul 12, 2016 · 4 comments


Copy link

@0xpablo 0xpablo commented Jul 12, 2016

Previous ID SR-2053
Radar None
Original Reporter @0xpablo
Type Bug
Status Resolved
Resolution Done

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

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 3.0Regression
Assignee @slavapestov
Priority Medium

md5: 791693fc805f219336b93066cbd69027

is duplicated by:

relates to:

Issue Description:

Since @noescape is now an attribute on the type, using it with type aliased closures results in a compiler error.

Code example:

typealias Handler = () -> ()

func foo(handler: @noescape Handler) { }


{code:bgColor=#FFFFFF| borderColor=#FF0000|borderWidth=2}
error: @NoEscape attribute only applies to function types
func foo(handler: @NoEscape Handler)

Copy link

@lattner lattner mannequin commented Jul 12, 2016

Ok, this is a known limitation in the compiler. It is definitely possible to extend this, but keep in mind that @NoEscape is supposed to go away in Swift 3. The issue will still exist though with the new @escaping attribute.

Copy link

@belkadan belkadan commented Aug 10, 2016

@milseman, there's a Radar for this too, right?

Copy link

@slavapestov slavapestov commented Aug 19, 2016

PR fo 3.0: PR for 3.0: #4388

Copy link

@slavapestov slavapestov commented Aug 20, 2016

Fix is now in master and swift-3.0-branch.

@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
None yet

No branches or pull requests

3 participants