zig/test/cases/compile_log.0.zig
r00ster91 ee4ced9683 write function types consistently with a space before fn keyword
Currently, the compiler (like @typeName) writes it `fn(...) Type` but
zig fmt writes it `fn (...) Type` (notice the space after `fn`).
This inconsistency is now resolved and function types are consistently
written the zig fmt way. Before this there were more `fn (...) Type`
occurrences than `fn(...) Type` already.
2023-09-19 15:15:05 +03:00

23 lines
497 B
Zig

export fn _start() noreturn {
const b = true;
var f: u32 = 1;
@compileLog(b, 20, f, x);
@compileLog(1000);
var bruh: usize = true;
_ = bruh;
unreachable;
}
export fn other() void {
@compileLog(1234);
}
fn x() void {}
// error
//
// :6:23: error: expected type 'usize', found 'bool'
//
// Compile Log Output:
// @as(bool, true), @as(comptime_int, 20), @as(u32, [runtime value]), @as(fn () void, (function 'x'))
// @as(comptime_int, 1000)
// @as(comptime_int, 1234)