Closed
Description
Zig Version
0.11.0-dev.168+b2ffe113d
Steps to Reproduce and Observed Behavior
This test should pass, but it fails due to the @compileError()
being triggered.
test "mutable capture of noreturn union field" {
const U = union(enum) {
a: u32,
b: noreturn,
};
var a = U{ .a = 1 };
switch (a) {
.a => {},
.b => |*val| {
_ = val;
@compileError("Shouldn't be triggered");
},
}
}
Expected Behavior
The test should pass. Note that we have test coverage in place for immutable captures and the given test passes if |val|
is used instead of |*val|
.