summaryrefslogtreecommitdiff
path: root/exercises/071_comptime6.zig
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2026-06-03 18:37:25 +0200
committerChris Boesch <chrboesch@noreply.codeberg.org>2026-06-03 18:37:25 +0200
commitb7ff71cb9e7fba6365e78f00bd75e0d5d507cbfc (patch)
tree6c3f664ff0a900e0d1132f54a1c0410baf389e33 /exercises/071_comptime6.zig
parentbeeca8d510891a272868f447e8193b0fcee7e2fc (diff)
parenta403436fe8ca2ce7fc53e81365f91ecc6051ef97 (diff)
Merge pull request 'Fix exercises 65, 71, 82 due to the build system update' (#443) from mark2185/exercises:fix-build-update into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/443
Diffstat (limited to 'exercises/071_comptime6.zig')
-rw-r--r--exercises/071_comptime6.zig9
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});
}
}