feat: fix nil equals nil, and fix funcs with discard params
This commit is contained in:
parent
9177267570
commit
ac14512706
|
@ -1837,7 +1837,9 @@ impl<'a> CodeGenerator<'a> {
|
||||||
| ArgName::NamedLabeled { name, .. } => {
|
| ArgName::NamedLabeled { name, .. } => {
|
||||||
args.push(name.clone());
|
args.push(name.clone());
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {
|
||||||
|
args.push("_".to_string());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let recursive = if let Ok(index) =
|
let recursive = if let Ok(index) =
|
||||||
|
@ -2596,6 +2598,9 @@ impl<'a> CodeGenerator<'a> {
|
||||||
};
|
};
|
||||||
arg_stack.push(term);
|
arg_stack.push(term);
|
||||||
return;
|
return;
|
||||||
|
} else if tipo.is_nil() {
|
||||||
|
arg_stack.push(Term::Constant(UplcConstant::Bool(true)));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Term::Apply {
|
Term::Apply {
|
||||||
|
@ -2705,9 +2710,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
// arg_stack.push(term);
|
// arg_stack.push(term);
|
||||||
// return;
|
// return;
|
||||||
todo!()
|
todo!()
|
||||||
} else if tipo.is_list()
|
} else if tipo.is_list() {
|
||||||
|| matches!(tipo.get_uplc_type(), UplcType::List(_))
|
|
||||||
{
|
|
||||||
let term = Term::Apply {
|
let term = Term::Apply {
|
||||||
function: Term::Apply {
|
function: Term::Apply {
|
||||||
function: Term::Apply {
|
function: Term::Apply {
|
||||||
|
@ -2745,6 +2748,9 @@ impl<'a> CodeGenerator<'a> {
|
||||||
|
|
||||||
arg_stack.push(term);
|
arg_stack.push(term);
|
||||||
return;
|
return;
|
||||||
|
} else if tipo.is_nil() {
|
||||||
|
arg_stack.push(Term::Constant(UplcConstant::Bool(false)));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Term::Apply {
|
Term::Apply {
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Should this fail or equal true?
|
||||||
|
// Should != be false or true?
|
||||||
|
|
||||||
test nil_1() {
|
test nil_1() {
|
||||||
Nil == Nil
|
Nil == Nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue