From 3b865a0c175e7537aeea389fb5f05c6e3489a685 Mon Sep 17 00:00:00 2001 From: Luka Markušić Date: Mon, 1 Jun 2026 15:41:22 +0200 Subject: Fix 082_anonymous_structs3.zig because of new build system --- patches/patches/082_anonymous_structs3.patch | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'patches') diff --git a/patches/patches/082_anonymous_structs3.patch b/patches/patches/082_anonymous_structs3.patch index 28a6728..972753d 100644 --- a/patches/patches/082_anonymous_structs3.patch +++ b/patches/patches/082_anonymous_structs3.patch @@ -1,32 +1,32 @@ ---- 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 +--- exercises/082_anonymous_structs3.zig 2026-06-01 15:59:11.872467805 +0200 ++++ answers/082_anonymous_structs3.zig 2026-06-01 15:58:38.004730144 +0200 +@@ -82,17 +82,17 @@ + // @typeInfo(Circle).@"struct".field_types // - // This will be an array of StructFields. -- const fields = ???; -+ const fields = @typeInfo(@TypeOf(tuple)).@"struct".fields; + // This will be an array of field types. +- const field_types = ???; ++ const field_types = @typeInfo(@TypeOf(tuple)).@"struct".field_types; + + // This will be an array of field names. +- const field_names = ???; ++ const field_names = @typeInfo(@TypeOf(tuple)).@"struct".field_names; // 2. Loop through each field. This must be done at compile // time. // // Hint: remember 'inline' loops? // -- for (fields) |field| { -+ inline for (fields) |field| { +- for (???, ???) |???, ???| { ++ inline for (field_types, field_names) |field_type, field_name| { // 3. Print the field's name, type, and value. // - // Each 'field' in this loop is one of these: -@@ -123,9 +123,9 @@ - // for declarations. If it's a value, it looks for data. - // + // You'll need this builtin: +@@ -116,7 +116,7 @@ print("\"{s}\"({any}):{any} ", .{ -- field.???, -- field.???, + field_name, + field_type, - ???, -+ field.name, -+ field.type, -+ @field(tuple, field.name), ++ @field(tuple, field_name), }); } } -- cgit v1.2.3