-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[sil] Add clarity to how load_weak [take] and store_weak effect an ob… #21985
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
[sil] Add clarity to how load_weak [take] and store_weak effect an ob… #21985
Conversation
…jects weak ref count.
20c0fae
to
cbb3f11
Compare
@swift-ci smoke test |
docs/SIL.rst
Outdated
* The value that was originally referenced by the weak reference will have | ||
its weak reference count decremented by 1. | ||
* If the optional is non-nil, the reference in the optional's strong reference count is not | ||
affected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "if" clause is unfortunate here; it ends up suggesting that the reference count is affected if the optional is nil, which is of course not what you mean. Just "The new value's weak reference count is incremented, and its strong reference count is not affected." should be clear enough. If you want to be explicit about what happens in the nil
case, you should do that for all the places you're modifying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WFM
@swift-ci smoke test and merge |
3 similar comments
@swift-ci smoke test and merge |
@swift-ci smoke test and merge |
@swift-ci smoke test and merge |
…jects weak ref count.