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-256] [Resilience] Resilient case numbering #42878

Closed
slavapestov opened this issue Dec 17, 2015 · 4 comments
Closed

[SR-256] [Resilience] Resilient case numbering #42878

slavapestov opened this issue Dec 17, 2015 · 4 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@slavapestov
Copy link
Member

Previous ID SR-256
Radar None
Original Reporter @slavapestov
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @slavapestov
Priority Medium

md5: fc0fdcd580f1385fb1acffb2d2a4341c

blocks:

  • SR-257 Resilient value type support -- umbrella bug

Issue Description:

Right now, the enum value witnesses number cases so that non-payload cases come after payload cases. This means adding new payload cases is never resilient. Change the numbering so that payload cases are negative and non-payload cases are positive.

@belkadan
Copy link
Contributor

Why do we separate them at all? Is it because we can use extra inhabitants? In that case, won't using negative values screw this up when there are entire spare bits?

@belkadan
Copy link
Contributor

cc @jckarter

@jckarter
Copy link
Member

It's better from a layout standpoint to consider all the payload cases first, figure out what extra inhabitants/spare bits you have available, then work out the tagging and non-payload representations afterward. The case numbering is arbitrary and the value witness can munge it into whatever's necessary to interact with the extra inhabitants interface. In fact, for the single-payload case, it's better to make the payload case negative since the extra inhabitant witnesses already use '-1' to mean 'not an extra inhabitant' and start numbering extra inhabitants at 0.

@slavapestov
Copy link
Member Author

rdar://24057774

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants