Compare commits

..

3 Commits

Author SHA1 Message Date
David Mak 45a549fb01 WIP - Fix string-like format 2024-08-12 17:02:26 +08:00
David Mak 2707735274 WIP - Fix bool format 2024-08-12 16:56:43 +08:00
David Mak 42f8dab980 WIP - Fix expected type of Tuple 2024-08-12 16:48:08 +08:00
1 changed files with 3 additions and 11 deletions

View File

@ -804,21 +804,13 @@ fn polymorphic_print<'ctx>(
}
match &*ctx.unifier.get_ty_immutable(ty) {
TypeEnum::TTuple { ty: tys, is_vararg_ctx: false } => {
debug_assert_eq!(
tys.len() as u32,
value.into_struct_value().count_fields(),
"Expected {} types for {}, got [{}] ({} types) in corresponding LLVM type",
tys.len(),
ctx.unifier.stringify(ty),
value.into_struct_value().get_fields().map(|field| field.get_type().to_string()).join(", "),
value.into_struct_value().count_fields(),
);
TypeEnum::TTuple { ty, is_vararg_ctx: false } => {
debug_assert_eq!(ty.len() as u32, value.into_struct_value().count_fields());
fmt.push('(');
flush(ctx, generator, &mut fmt, &mut args);
let tuple_vals = tys
let tuple_vals = ty
.iter()
.enumerate()
.map(|(i, ty)| {