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-15873] Documentation for withUnsafeCurrentTask refers to non-existent property UnsafeCurrentTask.task #58138

Open
ole opened this issue Feb 16, 2022 · 1 comment

Comments

@ole
Copy link
Contributor

@ole ole commented Feb 16, 2022

Previous ID SR-15873
Radar None
Original Reporter @ole
Type Bug
Environment

This is the state of the documentation at https://developer.apple.com/documentation/swift/3815003-withunsafecurrenttask on 2022-02-16 (Swift 5.5).

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

md5: d028dc708a057ae6830a4808d7cf2fd3

Issue Description:

The documentation for withUnsafeCurrentTask says:

Instead, use the task property of UnsafeCurrentTask to access an instance of Task that you can store long-term and interact with outside of the closure body.

Problem: UnsafeCurrentTask has no public task property (and shouldn't as far as I can tell), so the documentation is incorrect.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@ole
Copy link
Contributor Author

@ole ole commented Apr 26, 2022

This issue still exists as of 2022-04-26. The documentation is wrong, whereas the doc comment in the Swift source code is much better:

/// There's no safe way to retrieve a reference to the current task
/// and save it for long-term use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant