-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[IRGen] Respect optionality of unowned(unsafe) reference properties #65663
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
Conversation
@swift-ci smoke test |
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.
@swift-ci smoke test |
Hm, I tested with a simplified test case and while it fixes that one, it does not seem to fix the original issue. Looking further into it. |
@swift-ci smoke test |
@aschwaighofer Fixed the other case as well. Ready for review. |
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.
great find!
@swift-ci smoke test macos |
…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
…65663) (#65701) * [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
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 benil
as well, even if it in fact contained a value.