WIP - Debug tuples
This commit is contained in:
parent
de21aaf907
commit
fea0a6934e
|
@ -805,15 +805,18 @@ 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(),
|
||||
);
|
||||
let value = value.into_struct_value();
|
||||
|
||||
println!("value: {:?}", value.get_type());
|
||||
// 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(),
|
||||
// );
|
||||
|
||||
fmt.push('(');
|
||||
flush(ctx, generator, &mut fmt, &mut args);
|
||||
|
@ -825,7 +828,7 @@ fn polymorphic_print<'ctx>(
|
|||
(
|
||||
*ty,
|
||||
unsafe {
|
||||
ValueEnum::from(value.into_struct_value().get_field_at_index_unchecked(i as u32))
|
||||
ValueEnum::from(value.get_field_at_index_unchecked(i as u32))
|
||||
},
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue