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

stage2: catch at comptime! #7628

Merged
merged 1 commit into from
Feb 26, 2021
Merged

stage2: catch at comptime! #7628

merged 1 commit into from
Feb 26, 2021

Conversation

g-w1
Copy link
Contributor

@g-w1 g-w1 commented Jan 1, 2021

improve stage2 to allow catch at comptime:

  • add error_union value tag.
  • add analyzeIsErr
  • add Value.isError
  • add TZIR wrap_errunion_payload and wrap_errunion_err for
    wrapping from T -> E!T and E -> E!T
  • add anlyzeInstUnwrapErrCode and analyzeInstUnwrapErr
  • add analyzeInstEnsureErrPayloadVoid:
  • add wrapErrorUnion
  • comparing error values for tests
  • tests!!!

@g-w1 g-w1 force-pushed the stage2-check-errs branch from 49d9b19 to d92189d Compare January 1, 2021 01:01
@andrewrk andrewrk added the frontend Tokenization, parsing, AstGen, Sema, and Liveness. label Jan 12, 2021
@g-w1 g-w1 mentioned this pull request Jan 18, 2021
@g-w1 g-w1 force-pushed the stage2-check-errs branch 3 times, most recently from e1930f2 to d80ce37 Compare January 19, 2021 03:56
@g-w1 g-w1 changed the title stage2: error union unwrapping checking stage2: catch at comptime! Jan 19, 2021
@g-w1 g-w1 marked this pull request as ready for review January 19, 2021 13:08
src/zir_sema.zig Show resolved Hide resolved
@g-w1 g-w1 force-pushed the stage2-check-errs branch 6 times, most recently from f8a4d00 to c612054 Compare January 31, 2021 00:08
src/zir_sema.zig Show resolved Hide resolved
@g-w1 g-w1 force-pushed the stage2-check-errs branch 2 times, most recently from e896459 to 2c71fe9 Compare February 1, 2021 12:02
Copy link
Member

@Vexu Vexu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nearly ready to go.

src/Module.zig Outdated Show resolved Hide resolved
src/Module.zig Outdated Show resolved Hide resolved
src/Module.zig Show resolved Hide resolved
src/astgen.zig Outdated Show resolved Hide resolved
src/value.zig Outdated Show resolved Hide resolved
@g-w1 g-w1 force-pushed the stage2-check-errs branch from 2c71fe9 to 43aa51e Compare February 3, 2021 19:29
@g-w1
Copy link
Contributor Author

g-w1 commented Feb 16, 2021

This is nearly ready to go.

Is there anything else I can do?

src/astgen.zig Outdated Show resolved Hide resolved
src/Module.zig Outdated Show resolved Hide resolved
src/Module.zig Outdated Show resolved Hide resolved
src/Module.zig Outdated Show resolved Hide resolved
* add error_union value tag.
* add analyzeIsErr
* add Value.isError
* add TZIR wrap_errunion_payload and wrap_errunion_err for
  wrapping from T -> E!T and E -> E!T
* add anlyzeInstUnwrapErrCode and analyzeInstUnwrapErr
* add analyzeInstEnsureErrPayloadVoid:
* add wrapErrorUnion
* add comptime error comparison for tests
* tests!
@g-w1 g-w1 force-pushed the stage2-check-errs branch from 43aa51e to ebea8ba Compare February 17, 2021 21:11
@andrewrk andrewrk merged commit 153c97a into ziglang:master Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants