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-9494] Disable @autoclosure forwarding and provide a fix-it to add () #51949

Closed
xedin opened this issue Dec 12, 2018 · 2 comments
Closed

[SR-9494] Disable @autoclosure forwarding and provide a fix-it to add () #51949

xedin opened this issue Dec 12, 2018 · 2 comments
Assignees
Labels
compiler The Swift compiler in itself task

Comments

@xedin
Copy link
Member

xedin commented Dec 12, 2018

Previous ID SR-9494
Radar rdar://problem/46224703
Original Reporter @xedin
Type Task
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Task
Assignee @xedin
Priority Medium

md5: 54ae7f91a74225aa04fdac657d4c50b8

duplicates:

  • SR-5719 Ban autoclosure forwarding

Issue Description:

Example of incorrect behavior:

func foo(_ fn: @autoclosure () -> Int) {}
func bar(_ fn: @autoclosure () -> Int) {
  foo(fn) // @autoclosure forwarding
}

This forwarding behavior shouldn't be allowed and was a consequence of function types having @autoclosure flags and various scattered checks in type-checker.

Only parameter declarations should be aware of @autoclosure, unlike @escaping which belongs to a function type itself.

@xedin
Copy link
Member Author

xedin commented Dec 12, 2018

Created this JIRA to be able to add information to CHANGELOG.md

@xedin
Copy link
Member Author

xedin commented Dec 12, 2018

Main @autoclosure rework PR - #20152
Diagnostic PR - #20713

@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
compiler The Swift compiler in itself task
Projects
None yet
Development

No branches or pull requests

1 participant