summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2026-02-27 19:09:51 +0100
committerChris Boesch <chrboesch@noreply.codeberg.org>2026-02-27 19:09:51 +0100
commitc03255063338f28cf452d5968380d18e1b58d13b (patch)
tree083c66a4bcf0938f6e9ad54f761a0adf7262ed35
parenta83a42528ef2c132678502ef5c375bbcf361121c (diff)
parent9db32388e3ffe206353f037a7706677e1719b429 (diff)
Merge pull request 'improve comment stating 'Zig 0.10.0' @typeName change' (#370) from pebose/exercises:improve-builtins2-comment-zig-0-10 into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/370
-rw-r--r--exercises/065_builtins2.zig7
-rw-r--r--patches/patches/065_builtins2.patch4
2 files changed, 6 insertions, 5 deletions
diff --git a/exercises/065_builtins2.zig b/exercises/065_builtins2.zig
index 2d13994..0fde989 100644
--- a/exercises/065_builtins2.zig
+++ b/exercises/065_builtins2.zig
@@ -137,12 +137,13 @@ pub fn main() void {
}
// NOTE: This exercise did not originally include the function below.
-// But a change after Zig 0.10.0 added the source file name to the
-// type. "Narcissus" became "065_builtins2.Narcissus".
+// After Zig 0.10.0, `@typeName` began prefixing the returned type name
+// with the source file name. For example, "Narcissus" became
+// "065_builtins2.Narcissus".
//
// To fix this, we've added this function to strip the filename from
// the front of the type name. (It returns a slice of the type name
-// starting at the index + 1 of character ".")
+// starting just after the ".")
//
// We'll be seeing @typeName again in Exercise 070. For now, you can
// see that it takes a Type and returns a u8 "string".
diff --git a/patches/patches/065_builtins2.patch b/patches/patches/065_builtins2.patch
index ad4192b..89fd652 100644
--- a/patches/patches/065_builtins2.patch
+++ b/patches/patches/065_builtins2.patch
@@ -1,5 +1,5 @@
---- exercises/065_builtins2.zig 2025-06-17 13:58:07.857258167 +0200
-+++ answers/065_builtins2.zig 2025-06-17 13:56:36.630415938 +0200
+--- exercises/065_builtins2.zig 2026-02-27 13:10:36
++++ answers/065_builtins2.zig 2026-02-27 13:10:52
@@ -58,7 +58,7 @@
// Oops! We cannot leave the 'me' and 'myself' fields
// undefined. Please set them here: