You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No, there should be no compile error. See the existing noreturn union field behavior tests.
This example doesn't demonstrate the motivating use-case for this behavior, namely "disabling" a tagged union field based on a comptime-known value. For example
constView=union(enum) {
xdg_toplevel: XdgToplevel,
xwayland_view: if (build_options.xwayland) XwaylandViewelsenoreturn,
}
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.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|
.The text was updated successfully, but these errors were encountered: