summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYevhen Babiichuk (DustDFG) <dfgdust@gmail.com>2025-03-13 20:49:41 +0200
committerYevhen Babiichuk (DustDFG) <dfgdust@gmail.com>2025-03-14 16:47:27 +0200
commit6f3cdcf0183efae4e3915e56a7257084ff8d0e4a (patch)
tree9c0eb6e20601a59909ed014f0deed117ab1673ef
parenteeb1246c2cf4f4c626a595c5652d5f4a96b84952 (diff)
Update type info for StructField type in 082
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
-rw-r--r--README.md1
-rw-r--r--exercises/082_anonymous_structs3.zig6
-rw-r--r--patches/patches/082_anonymous_structs3.patch6
3 files changed, 8 insertions, 5 deletions
diff --git a/README.md b/README.md
index 63b96fe..2838209 100644
--- a/README.md
+++ b/README.md
@@ -233,6 +233,7 @@ Zig Core Language
* [X] Interfaces
* [X] Bit manipulation
* [X] Working with C
+* [ ] Opaque types (anyopaque)
* [X] Threading
* [x] Labeled switch
* [x] Vector operations (SIMD)
diff --git a/exercises/082_anonymous_structs3.zig b/exercises/082_anonymous_structs3.zig
index 573d0bb..469cd66 100644
--- a/exercises/082_anonymous_structs3.zig
+++ b/exercises/082_anonymous_structs3.zig
@@ -95,13 +95,15 @@ fn printTuple(tuple: anytype) void {
// Each 'field' in this loop is one of these:
//
// pub const StructField = struct {
- // name: []const u8,
+ // name: [:0]const u8,
// type: type,
- // default_value: anytype,
+ // default_value_ptr: ?*const anyopaque,
// is_comptime: bool,
// alignment: comptime_int,
// };
//
+ // Note we will learn about 'anyopaque' type later
+ //
// You'll need this builtin:
//
// @field(lhs: anytype, comptime field_name: []const u8)
diff --git a/patches/patches/082_anonymous_structs3.patch b/patches/patches/082_anonymous_structs3.patch
index b918011..0f71a94 100644
--- a/patches/patches/082_anonymous_structs3.patch
+++ b/patches/patches/082_anonymous_structs3.patch
@@ -1,5 +1,5 @@
---- exercises/082_anonymous_structs3.zig 2024-09-07 19:13:58.210327580 +0200
-+++ answers/082_anonymous_structs3.zig 2024-09-07 19:21:20.972733477 +0200
+--- 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
@@ -82,14 +82,14 @@
// @typeInfo(Circle).@"struct".fields
//
@@ -17,7 +17,7 @@
// 3. Print the field's name, type, and value.
//
// Each 'field' in this loop is one of these:
-@@ -117,9 +117,9 @@
+@@ -119,9 +119,9 @@
//
// The first field should print as: "0"(bool):true
print("\"{s}\"({any}):{any} ", .{