Skip to content

Add @_implicitSelfCapture to asyncDetached. #37096

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

Merged

Conversation

DougGregor
Copy link
Member

Like async, asyncDetached should not require self. because it is
unlikely to introduce cycles.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, agree with the reasoning behind it 👍

It would seem we may be moving to a future of more relaxes self enforcement in general then.

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, this put the annotation on the wrong thing -- should be on the property not the type it seems.

@ktoso
Copy link
Contributor

ktoso commented Apr 28, 2021

Failure was:


00:35:49.393   operation: __owned @_implicitSelfCapture @Sendable @escaping () async -> T
00:35:49.393                      ~^~~~~~~~~~~~~~~~~~~~~

as it should be
@_implicitSelfCapture operation: __owned @Sendable @escaping () async -> T

I'll fix that and re run

@ktoso
Copy link
Contributor

ktoso commented Apr 28, 2021

@swift-ci please smoke test and merge

Like `async`, `asyncDetached` should not require `self.` because it is
unlikely to introduce cycles.
@DougGregor DougGregor force-pushed the async-detached-implicit-self-capture branch from 8779635 to 2000bf9 Compare April 28, 2021 00:03
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor merged commit a0f8b48 into swiftlang:main Apr 28, 2021
@DougGregor DougGregor deleted the async-detached-implicit-self-capture branch April 28, 2021 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants