Files
zig/test/cases/compile_errors/ignored_comptime_value.zig
2023-04-12 12:06:19 -04:00

21 lines
500 B
Zig

export fn a() void {
comptime 1;
}
export fn b() void {
comptime bar();
}
fn bar() u8 {
return 2;
}
// error
// backend=stage2
// target=native
//
// :2:5: error: value of type 'comptime_int' ignored
// :2:5: note: all non-void values must be used
// :2:5: note: this error can be suppressed by assigning the value to '_'
// :5:5: error: value of type 'u8' ignored
// :5:5: note: all non-void values must be used
// :5:5: note: this error can be suppressed by assigning the value to '_'