mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
This is all of the expected 0.14.0 progress on #21530, which can now be postponed once this commit is merged. This required rewriting the (un)wrap operations since the original implementations were extremely buggy. Also adds an easy way to retrigger Sema OPV bugs so that I don't have to keep updating #22419 all the time.
16 lines
245 B
Zig
16 lines
245 B
Zig
fn assert(ok: bool) void {
|
|
if (!ok) unreachable;
|
|
}
|
|
|
|
pub fn main() void {
|
|
var x: u32 = 0;
|
|
for ("hello") |_| {
|
|
x += 1;
|
|
}
|
|
assert("hello".len == x);
|
|
}
|
|
|
|
// run
|
|
// backend=stage2,llvm
|
|
// target=x86_64-linux,x86_64-macos
|
|
//
|