Skip to content

Conversation

@mcncl
Copy link

@mcncl mcncl commented Feb 7, 2026

Description

The code in the current error union demo code, named maybe_error would never actually error. This change improves on the demonstration of how catch works by actually using it.

Changes

Sets the maybe_error to be of value AllocationError.OutOfMemory which means the value of no_error would use the catch, displaying the way that catch is used in Zig with an error union.

mcncl added 2 commits February 7, 2026 20:51
The code in the current error union demo code, named `maybe_error` would
never actually error. This change improves on the demonstration of how
`catch` works by actually using it.
When we run our test we're comparing at runtime but need to compare at
comptime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant