From 2e981d408fcf88dea67211a911c9c35ea3645d7c Mon Sep 17 00:00:00 2001 From: Paul Ebose Date: Fri, 27 Feb 2026 03:48:11 +0100 Subject: [PATCH 1/2] add hint that @field() works differently on types and values --- exercises/082_anonymous_structs3.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/082_anonymous_structs3.zig b/exercises/082_anonymous_structs3.zig index 469cd66..c13774f 100644 --- a/exercises/082_anonymous_structs3.zig +++ b/exercises/082_anonymous_structs3.zig @@ -118,6 +118,10 @@ fn printTuple(tuple: anytype) void { // @field(foo, "x"); // returns the value at foo.x // // The first field should print as: "0"(bool):true + // + // Hint: Be careful! If your 'lhs' is a type, @field() looks + // for declarations. If it's a value, it looks for data. + // print("\"{s}\"({any}):{any} ", .{ field.???, field.???, From 53f7e015cbc3966e70b6436415c1e1421ae7f8cf Mon Sep 17 00:00:00 2001 From: Paul Ebose Date: Fri, 27 Feb 2026 13:09:54 +0100 Subject: [PATCH 2/2] update patch file --- patches/patches/082_anonymous_structs3.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/patches/082_anonymous_structs3.patch b/patches/patches/082_anonymous_structs3.patch index 0f71a94..28a6728 100644 --- a/patches/patches/082_anonymous_structs3.patch +++ b/patches/patches/082_anonymous_structs3.patch @@ -1,5 +1,5 @@ ---- exercises/082_anonymous_structs3.zig 2025-03-14 16:41:17.892873287 +0200 -+++ answers/082_anonymous_structs3.zig 2025-03-14 16:40:56.043829543 +0200 +--- exercises/082_anonymous_structs3.zig 2026-02-27 13:05:46 ++++ answers/082_anonymous_structs3.zig 2026-02-27 13:07:22 @@ -82,14 +82,14 @@ // @typeInfo(Circle).@"struct".fields // @@ -17,9 +17,9 @@ // 3. Print the field's name, type, and value. // // Each 'field' in this loop is one of these: -@@ -119,9 +119,9 @@ +@@ -123,9 +123,9 @@ + // for declarations. If it's a value, it looks for data. // - // The first field should print as: "0"(bool):true print("\"{s}\"({any}):{any} ", .{ - field.???, - field.???,