| author | |
| committer | |
| log | 1f0b77b3b88112ef458f62c23df72003c843e7cc |
| tree | 14c1b4f803df6474bb84ff902e65e002fec26292 |
| parent | a201d80253c79bd6a024cc3dfdad803570fe6c3b |
| signature | Signed by PGP key 4AEE18F83AFDEB23 |
2 files changed, 16 insertions(+), 1 deletions(-)
src/type.zig+5-1| ... | @@ -520,9 +520,13 @@ pub const Type = extern union { | ... | @@ -520,9 +520,13 @@ pub const Type = extern union { |
| 520 | } | 520 | } |
| 521 | return a.tag() == b.tag(); | 521 | return a.tag() == b.tag(); |
| 522 | }, | 522 | }, |
| 523 | .ErrorUnion => { | ||
| 524 | const a_data = a.castTag(.error_union).?.data; | ||
| 525 | const b_data = b.castTag(.error_union).?.data; | ||
| 526 | return a_data.error_set.eql(b_data.error_set) and a_data.payload.eql(b_data.payload); | ||
| 527 | }, | ||
| 523 | .Opaque, | 528 | .Opaque, |
| 524 | .Float, | 529 | .Float, |
| 525 | .ErrorUnion, | ||
| 526 | .ErrorSet, | 530 | .ErrorSet, |
| 527 | .BoundFn, | 531 | .BoundFn, |
| 528 | .Frame, | 532 | .Frame, |
test/stage2/wasm.zig+11| ... | @@ -600,5 +600,16 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -600,5 +600,16 @@ pub fn addCases(ctx: *TestContext) !void { |
| 600 | \\ return error.Bruh; | 600 | \\ return error.Bruh; |
| 601 | \\} | 601 | \\} |
| 602 | , "69\n"); | 602 | , "69\n"); |
| 603 | case.addCompareOutput( | ||
| 604 | \\pub export fn _start() u32 { | ||
| 605 | \\ var e = foo(); | ||
| 606 | \\ const i = e catch 42; | ||
| 607 | \\ return i; | ||
| 608 | \\} | ||
| 609 | \\ | ||
| 610 | \\fn foo() anyerror!u32 { | ||
| 611 | \\ return error.Dab; | ||
| 612 | \\} | ||
| 613 | , "42\n"); | ||
| 603 | } | 614 | } |
| 604 | } | 615 | } |