-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Special-case switching on error union capture #18173
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
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
063d55c
zir: remove unused zir as instruction
dweiller 4136097
zir: add switch_block_err_union
dweiller b784f64
sema: refactor error set switch logic
dweiller 2cf648f
astgen: use switch_block_err_union
dweiller ae19f69
sema: implement switch_block_err_union on comptime operands
dweiller 6bf319e
sema: extract runtime switch AIR generation to function
dweiller a175a64
sema: implement runtime switch_block_err_union
dweiller 2fa69cc
sema: allow maybeErrorUnwrap to handle err_union_code
dweiller adcaad6
sema: fix err union switch with inferred empty error sets
dweiller b7eb59f
fix x86_64 crashes for switch_block_err_union
dweiller 6a18cee
astgen/sema: use switch_block_err_union for if-else-switch
dweiller 8695bc7
langref: mention error union switch peer resolution
dweiller fc6dc79
astgen/sema: fix source locations for switch_block_err_union
dweiller 69ab687
test: add tests for switch_block_err_union
dweiller ec5b751
sema: inherit block want_safety for err switch union
dweiller 67d7d7b
fixup! astgen: use switch_block_err_union
dweiller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't like how this turns a limitation of the compiler into a feature of the language.
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.
I was just trying to be clear about what the behaviour is so as to not cause confusion, but I can see that this may the source of future problems if peer type resolution changes for these cases. Should I remove the sentence, or add a note saying something along the lines of 'this is the current behaviour and may change'?
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.
I think it's good enough for now. I need to go over the langref anyway; it's collected quite a few different contributors' conflicting ideas about what a langref should be and it needs to be reworked by one person with a vision.