Hello, it would be amazing if we could view all computed error variants in the popup for the captured error. I do know that zig has some way to get the error variants for a function as shown by running the following program:
Gives us errors for each of the unhandled error variants in the switch:
./example.zig:15:27: error: error.A not handled in switch
magicBox(5) catch |e| switch (e) {};
^
./example.zig:14:21: note: referenced here
pub fn main() !void {
^
/opt/compiler-explorer/zig-0.9.0/lib/std/start.zig:553:40: note: referenced here
const result = root.main() catch |err| {
^
./example.zig:15:27: error: error.B not handled in switch
magicBox(5) catch |e| switch (e) {};
^
./example.zig:15:27: error: error.C not handled in switch
magicBox(5) catch |e| switch (e) {};
Personally, I would like it if when you scrolled over the captured e, it would show something like error{ A, B, C } which includes all of the variants.
I know this would take a bit of work, and I don't have time right now to contribute. But, it would be great so I'll just mark it down here as a wish in a bottle until I possibly attempt to implement it. Thanks
Hello, it would be amazing if we could view all computed error variants in the popup for the captured error. I do know that zig has some way to get the error variants for a function as shown by running the following program:
Gives us errors for each of the unhandled error variants in the switch:
Personally, I would like it if when you scrolled over the captured
e
, it would show something likeerror{ A, B, C }
which includes all of the variants.I know this would take a bit of work, and I don't have time right now to contribute. But, it would be great so I'll just mark it down here as a wish in a bottle until I possibly attempt to implement it. Thanks