From faa3bb97ad74e8285e06c9fa98ae0b039051d17e Mon Sep 17 00:00:00 2001 From: David Mak Date: Fri, 19 Jul 2024 16:08:46 +0800 Subject: [PATCH] core/typecheck/typedef: Add vararg to Unifier::stringify --- nac3core/src/typecheck/typedef/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nac3core/src/typecheck/typedef/mod.rs b/nac3core/src/typecheck/typedef/mod.rs index ef65ab66..99a282f2 100644 --- a/nac3core/src/typecheck/typedef/mod.rs +++ b/nac3core/src/typecheck/typedef/mod.rs @@ -1407,17 +1407,21 @@ impl Unifier { .args .iter() .map(|arg| { + let vararg_prefix = if arg.is_vararg { "*" } else { "" }; + if let Some(dv) = &arg.default_value { format!( - "{}:{}={}", + "{}:{}{}={}", arg.name, + vararg_prefix, self.internal_stringify(arg.ty, obj_to_name, var_to_name, notes), dv ) } else { format!( - "{}:{}", + "{}:{}{}", arg.name, + vararg_prefix, self.internal_stringify(arg.ty, obj_to_name, var_to_name, notes) ) }