blob: 3e8e247dacf8410b69f9a8669ed459661ef78f8c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
extern "c" fn write(c_int, usize, usize) usize;
pub fn main() void {
var i: u32 = 0;
inline while (i < 4) : (i += 1) print();
assert(i == 4);
}
fn print() void {
_ = write(1, @ptrToInt("hello\n"), 6);
}
pub fn assert(ok: bool) void {
if (!ok) unreachable; // assertion failure
}
// error
//
// :5:21: error: unable to resolve comptime value
// :5:21: note: condition in comptime branch must be comptime-known
|