Zig Version
0.17.0-dev.292+fc1c83a36
ZLS Version
0.17.0-dev.44+8da87d4f
Client / Code Editor / Extensions
VSCodium (1.116.0) with ziglang.vscode-zig (0.6.18)
Steps to Reproduce and Observed Behavior
const S = struct {
alpha: u32,
};
/// a value that ZLS cannot resolve
const unknown = unknown;
// good
const A = switch (unknown) {
1 => S,
else => unknown,
};
// bad
const B = switch (unknown) {
1 => S,
else => unreachable,
};
// bad
const C = switch (unknown) {
1 => S,
else => undefined,
};
// kind of works. Hover indicates that it isn't cleanly resolve to just `S`
const D = switch (unknown) {
1 => S,
else => @compileError(""),
};
Expected Behavior
The else branch of the switch cases should be ignored in all examples so that A, B, C, D all resolve to S.
Attach ZLS log output
No response
Zig Version
0.17.0-dev.292+fc1c83a36
ZLS Version
0.17.0-dev.44+8da87d4f
Client / Code Editor / Extensions
VSCodium (1.116.0) with ziglang.vscode-zig (0.6.18)
Steps to Reproduce and Observed Behavior
Expected Behavior
The
elsebranch of the switch cases should be ignored in all examples so thatA,B,C,Dall resolve toS.Attach ZLS log output
No response