mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-06-24 01:21:16 -04:00
2e3fac3626
backend=auto (now the default if backend is omitted) means to let the compiler pick whatever backend it wants as the default. This is important for platforms where we don't yet have a self-hosted backend, such as loongarch64. Also purge a bunch of redundant target=native.
17 lines
311 B
Zig
17 lines
311 B
Zig
export fn foo() void {
|
|
const x = switch (bar()) {
|
|
1, 2 => 1,
|
|
3, 4 => 2,
|
|
else => 3,
|
|
};
|
|
_ = x;
|
|
}
|
|
fn bar() i32 {
|
|
return 2;
|
|
}
|
|
|
|
// error
|
|
//
|
|
// :2:15: error: value with comptime-only type 'comptime_int' depends on runtime control flow
|
|
// :2:26: note: runtime control flow here
|