Formatter did not properly handle "null" for any, and null for empty faults. #2375

This commit is contained in:
Christoffer Lerno
2025-08-06 11:23:56 +02:00
parent 3b6d68ef21
commit 9c770f360e
3 changed files with 35 additions and 2 deletions

View File

@@ -146,10 +146,12 @@ fn usz? Formatter.out_str(&self, any arg) @private
case VOID:
return self.out_substr("void");
case FAULT:
return self.out_substr((*(fault*)arg.ptr).nameof);
fault f = *(fault*)arg.ptr;
return self.out_substr(f ? f.nameof : "(nofault)");
case INTERFACE:
case ANY:
return self.out_str(*(any*)arg);
any a = *(any*)arg;
return a ? self.out_str(a) : self.out_substr("(null)");
case OPTIONAL:
unreachable();
case SIGNED_INT: