Skip to content

Commit

Permalink
procure test for ziglang#8333
Browse files Browse the repository at this point in the history
  • Loading branch information
RetroDev256 committed Sep 9, 2024
1 parent dda7184 commit d07d070
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/cases/undefined_initialization_of_error_unions.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const builtin = @import("builtin");

pub fn main() !void {
if (builtin.mode == .Debug) {
var foo: ?u32 = undefined;
if (foo == null) return error.Miscompilation;
foo = undefined;
}
var a: anyerror!u32 = undefined;
_ = a catch return error.Miscompilation;
a = undefined;
}

// run
//

0 comments on commit d07d070

Please sign in to comment.