From 29bae1fbd6dc3df92a3a13dd0d0eb72b34f47710 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Wed, 6 Aug 2025 11:28:36 +0200 Subject: [PATCH] Updated like the PR #2375 --- lib/std/io/formatter.c3 | 6 ++++-- test/unit/regression/formatting.c3 | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/std/io/formatter.c3 b/lib/std/io/formatter.c3 index dc408dc4a..bbbdce3c5 100644 --- a/lib/std/io/formatter.c3 +++ b/lib/std/io/formatter.c3 @@ -147,11 +147,13 @@ fn usz? Formatter.out_str(&self, any arg) @private return self.out_substr("void"); case FAULT: fault f = *(fault*)arg.ptr; - return self.out_substr(f ? f.nameof : "(nofault)"); + return self.out_substr(f ? f.nameof : "(empty-fault)"); case INTERFACE: + any a = *(any*)arg; + return a ? self.out_str(a) : self.out_substr("(empty-interface)"); case ANY: any a = *(any*)arg; - return a ? self.out_str(a) : self.out_substr("(null)"); + return a ? self.out_str(a) : self.out_substr("(empty-any)"); case OPTIONAL: unreachable(); case SIGNED_INT: diff --git a/test/unit/regression/formatting.c3 b/test/unit/regression/formatting.c3 index 89300e509..5608fc317 100644 --- a/test/unit/regression/formatting.c3 +++ b/test/unit/regression/formatting.c3 @@ -20,10 +20,13 @@ fn void various_cornercases() @test test::eq(string::tformat("%s", z), "[100]"); fault p; fault o = DERP; - test::eq(string::tformat("%s|%s", p, o), "(nofault)|format_test::DERP"); + test::eq(string::tformat("%s|%s", p, o), "(empty-fault)|format_test::DERP"); Decl y; - test::eq(string::tformat("%s", y), "(null)"); + test::eq(string::tformat("%s", y), "(empty-interface)"); + + any xx; + test::eq(string::tformat("%s", xx), "(empty-any)"); int* x; test::eq(string::tformat("%s", x), "0x0");