fix: builtins using the incorrect data to type conversion when used as a function param.

This commit is contained in:
microproofs
2023-06-23 14:30:29 -04:00
committed by Kasey
parent db369da96e
commit 226556bdd6
3 changed files with 15 additions and 2 deletions

View File

@@ -4168,6 +4168,11 @@ impl<'a> CodeGenerator<'a> {
arg_vec.push(arg_stack.pop().unwrap());
}
let tipo = match tipo.as_ref() {
Type::Fn { ret, .. } => ret,
_ => &tipo,
};
let term = match &func {
DefaultFunction::IfThenElse
| DefaultFunction::ChooseUnit
@@ -4181,11 +4186,11 @@ impl<'a> CodeGenerator<'a> {
DefaultFunction::FstPair
| DefaultFunction::SndPair
| DefaultFunction::HeadList => {
builder::undata_builtin(&func, count, &tipo, arg_vec)
builder::undata_builtin(&func, count, tipo, arg_vec)
}
DefaultFunction::MkCons | DefaultFunction::MkPairData => {
builder::to_data_builtin(&func, count, &tipo, arg_vec)
builder::to_data_builtin(&func, count, tipo, arg_vec)
}
_ => {
let mut term: Term<Name> = func.into();