master
1comptime {
2 const undef: i64 = undefined;
3 const not_undef: i64 = 32;
4
5 // If the RHS is zero, then the LHS is returned, even if it is undefined.
6 @compileLog(undef -| 0);
7 @compileLog(not_undef -| 0);
8 // If either of the operands are undefined, the result is undefined.
9 @compileLog(undef -| not_undef);
10 @compileLog(not_undef -| undef);
11 @compileLog(undef -| undef);
12}
13
14// error
15//
16// :6:5: error: found compile log statement
17//
18// Compile Log Output:
19// @as(i64, undefined)
20// @as(i64, 32)
21// @as(i64, undefined)
22// @as(i64, undefined)
23// @as(i64, undefined)