forked from M-Labs/nac3
1
0
Fork 0

core/typecheck/typedef: Add vararg to Unifier::stringify

This commit is contained in:
David Mak 2024-07-19 16:08:46 +08:00
parent 6a64c9d1de
commit faa3bb97ad
1 changed files with 6 additions and 2 deletions

View File

@ -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)
)
}