diff options
| author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-04-30 19:53:56 +0200 |
|---|---|---|
| committer | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-04-30 19:53:56 +0200 |
| commit | 6048e6ef21b670b7fab6e9ae0c59a87550aceb6c (patch) | |
| tree | 489beb8f2ebdd4e1700dcd2bfb2f799d72470ea0 /exercises | |
| parent | 4bdcf195b982ae78181b1f8b9d64017e7aa5e5a5 (diff) | |
| parent | 3a782a96d5fdad216c45c6c6af06a8a85ff59340 (diff) | |
Merge pull request 'fixed compileError printing' (#419) from i418 into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/419
Diffstat (limited to 'exercises')
| -rw-r--r-- | exercises/074_comptime9.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/exercises/074_comptime9.zig b/exercises/074_comptime9.zig index 50894fd..1fc8e31 100644 --- a/exercises/074_comptime9.zig +++ b/exercises/074_comptime9.zig @@ -1,4 +1,5 @@ -const print = @import("std").debug.print; +const std = @import("std"); +const print = std.debug.print; // We're going to (ab)use the power of Zig to make animal hybrid creatures! // What do you think a GatorMouse would look like? Eek. @@ -58,7 +59,7 @@ fn makeCreature(comptime count: usize, comptime fmt: []const u8) [count]Animal { // other animals or is this an error? 'g' => ???, - else => @compileError("No animal starts with '" ++ char ++ "'!"), + else => @compileError(std.fmt.comptimePrint("No animal starts with '{c}'!", .{char})), }, .l => switch (char) { |
