diff options
| author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-02-27 19:17:59 +0100 |
|---|---|---|
| committer | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-02-27 19:17:59 +0100 |
| commit | 908109df2d4990f1fdc3ed32dd84edf0bf9a99a1 (patch) | |
| tree | fa82a9f5551dae0b179362dadc9b1a8f4fd373a8 /exercises | |
| parent | c03255063338f28cf452d5968380d18e1b58d13b (diff) | |
| parent | 53f7e015cbc3966e70b6436415c1e1421ae7f8cf (diff) | |
Merge pull request 'add hint that @field() works differently on types and values' (#367) from pebose/exercises:add-hint-to-exercise-82 into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/367
Diffstat (limited to 'exercises')
| -rw-r--r-- | exercises/082_anonymous_structs3.zig | 4 |
1 files changed, 4 insertions, 0 deletions
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.???, |
