Skip to content

[5.9][IRGen] Respect optionality of unowned(unsafe) reference properties #65701

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
merged 1 commit into from
May 5, 2023

Conversation

drexin
Copy link
Contributor

@drexin drexin commented May 5, 2023

Cherry-picked from: #65663

rdar://108705703

When generating the type info for fields marked unowned(unsafe) of an optional reference (e.g. AnyObject?), we dropped the fact that it was optional along the way. This caused incorrect tags to be returned when on object of the type was stored in an optional itself and the unowned property contained nil. In those cases the outer optional appeared to be nil as well, even if it in fact contained a value.

…wiftlang#65663)

* [IRGen] Respect optionality of unowned(unsafe) reference properties

rdar://108705703

When generating the type info for fields marked unowned(unsafe) of an optional reference (e.g. AnyObject?), we dropped the fact that it was optional along the way. This caused incorrect tags to be returned when on object of the type was stored in an optional itself and the unowned property contained `nil`. In those cases the outer optional appeared to be `nil` as well, even if it in fact contained a value.

* Fix additional case
@drexin drexin requested a review from a team as a code owner May 5, 2023 16:40
@drexin
Copy link
Contributor Author

drexin commented May 5, 2023

@swift-ci test

@drexin drexin merged commit 03ff4a3 into swiftlang:release/5.9 May 5, 2023
@drexin drexin deleted the wip-108705703-5.9 branch May 5, 2023 21:56
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