From c166b6a21d019f4e4087ba1331a2c21fb90eb026 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 11 Jun 2022 01:40:58 +0100 Subject: [PATCH] Support optional length parameter on struct tags for multi-pointers --- core/fmt/fmt.odin | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index 4772ffb71..2a2875247 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -1709,6 +1709,11 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) { elem := runtime.type_info_base(info.elem) if elem != nil { + if n, ok := fi.optional_len.?; ok { + fmt_array(fi, ptr, n, elem.size, elem, verb) + return + } + #partial switch e in elem.variant { case runtime.Type_Info_Array, runtime.Type_Info_Slice,