From 5d468ccbf0b9c5af965ff081fe11d0fc609cb075 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Mon, 24 Nov 2025 17:11:19 +0100 Subject: [PATCH] - Make printing typeids give some helpful typeid data. --- lib/std/io/formatter.c3 | 4 ++-- releasenotes.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/std/io/formatter.c3 b/lib/std/io/formatter.c3 index fef066913..fe8cd14d3 100644 --- a/lib/std/io/formatter.c3 +++ b/lib/std/io/formatter.c3 @@ -141,8 +141,6 @@ fn usz? Formatter.out_str(&self, any arg) @private { switch (arg.type.kindof) { - case TYPEID: - return self.out_substr("typeid"); case VOID: return self.out_substr("void"); case FAULT: @@ -188,6 +186,8 @@ fn usz? Formatter.out_str(&self, any arg) @private if (@catch(n) != NOT_FOUND) n!; switch (arg.type.kindof) { + case TYPEID: + return self.out_substr("typeid[")! + self.ntoa((iptr)*(typeid*)arg, false, 16)! + self.out_substr("]")!; case ENUM: usz i = types::any_to_enum_ordinal(arg, usz)!!; assert(i < arg.type.names.len, "Illegal enum value found, numerical value was %d.", i); diff --git a/releasenotes.md b/releasenotes.md index 60ba46ad9..5a2943df9 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -49,6 +49,7 @@ - Deprecate objc enums in favour of const inline enums backed by NS numerical types, and with the NS prefix, to better align with the objc api (macOS). - Deprecate `event_type_from` function in favour of using NSEvent directly, to better align with the objc api (macOS). - Add unit tests for objc and core_foundation (macOS). +- Make printing typeids give some helpful typeid data. ## 0.7.7 Change list