Files
zig/test/cases/compile_errors/@expect_non_bool.zig
David Rubin a7de02e052 implement @expect builtin (#19658)
* implement `@expect`

* add docs

* add a second arg for expected bool

* fix typo

* move `expect` to use BinOp

* update to newer langref format
2024-05-22 10:51:16 -05:00

12 lines
181 B
Zig

export fn a() void {
var x: u32 = 10;
_ = &x;
_ = @expect(x, true);
}
// error
// backend=stage2
// target=native
//
// :4:17: error: expected type 'bool', found 'u32'