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-7769] Dynamically upgrade existing boxed values to NSObject subclasses #50308

Open
jckarter opened this issue May 24, 2018 · 0 comments
Open
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@jckarter
Copy link
Member

Previous ID SR-7769
Radar None
Original Reporter @jckarter
Type Bug
Additional Detail from JIRA
Votes 1
Component/s Standard Library
Labels Bug
Assignee @millenomi
Priority Medium

md5: 369eca9ec5c6064f972350d71a361043

Issue Description:

AnyObject boxing on non-Darwin platforms has to contend with the contradictory requirements that `x as AnyObject` ought to work consistently regardless of whether Foundation is present, but the generic box for unbridged value types ought to be an NSObject subclass when Foundation is present. Currently we dynamically choose a box type based on whether Foundation is present, but this breaks down if a process starts up without Foundation and dynamically loads some library that uses Foundation later. We could instead look into ways to dynamically promote the metadata for value boxes to become an
NSObject when Foundation is loaded, so that existing boxed values continue to work.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

1 participant