diff options
| author | Luka Markušić <markusicluka@gmail.com> | 2026-06-01 15:37:05 +0200 |
|---|---|---|
| committer | Luka Markušić <markusicluka@gmail.com> | 2026-06-01 15:37:05 +0200 |
| commit | 63c798637cbb8b73ac0348933cc8dc42bfa9810a (patch) | |
| tree | 9b086a3ceb59ad32840b182282783176b4b89662 /exercises/071_comptime6.zig | |
| parent | 4480762e83f9c9f56a397b743a3d5867e1abf499 (diff) | |
Fix 071_comptime6.zig because of new build system
Diffstat (limited to 'exercises/071_comptime6.zig')
| -rw-r--r-- | exercises/071_comptime6.zig | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/exercises/071_comptime6.zig b/exercises/071_comptime6.zig index ce76607..3df9299 100644 --- a/exercises/071_comptime6.zig +++ b/exercises/071_comptime6.zig @@ -36,13 +36,14 @@ pub fn main() void { // statement was repeated three times almost verbatim. Yuck! // // Please use an 'inline for' to implement the block below - // for each field in the slice 'fields'! + // for each field in the corresponding slices (they're of the same length)! - const fields = @typeInfo(Narcissus).@"struct".fields; + const field_names = @typeInfo(Narcissus).@"struct".field_names; + const field_types = @typeInfo(Narcissus).@"struct".field_types; ??? { - if (field.type != void) { - print(" {s}", .{field.name}); + if (field_type != void) { + print(" {s}", .{field_name}); } } |
