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-2440] @escaping shouldn't be allowed outside of function param types #45045

Closed
jtbandes opened this issue Aug 20, 2016 · 2 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers parser Area → compiler: The legacy C++ parser

Comments

@jtbandes
Copy link
Collaborator

Previous ID SR-2440
Radar None
Original Reporter @jtbandes
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, Parser, StarterBug
Assignee None
Priority Medium

md5: 9b7c2291eec4b11174258156f4047a75

Issue Description:

Unless I'm mistaken, @escaping is meaningless unless it annotates the type of a function parameter.

This works today, but I think it should be an error:

func foo() -> (@escaping () -> ()) { fatalError() }
@jtbandes
Copy link
Collaborator Author

Here's some proof that escaping/noescape doesn't affect return types:

@belkadan
Copy link
Contributor

This has been fixed in master.

@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 diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers parser Area → compiler: The legacy C++ parser
Projects
None yet
Development

No branches or pull requests

2 participants