re-introduce code-gen patch, but with a test.

Actually, this has been a bug for a long time it seems. Calling any
  prelude functions using a qualified import would result in a codegen
  crash. Whoopsie.

  This is now fixed as shown by the regression test.
This commit is contained in:
KtorZ
2024-07-19 09:40:05 +02:00
parent 5afcc9b0c1
commit a9d782e206
2 changed files with 36 additions and 2 deletions

View File

@@ -7003,3 +7003,25 @@ fn bls12_381_elements_from_data_conversion() {
false,
)
}
#[test]
fn qualified_prelude_functions() {
let src = r#"
use aiken
test foo() {
aiken.identity(True) && identity(True)
}
"#;
let constant_true = Term::Constant(Constant::Bool(true).into());
let constant_false = Term::Constant(Constant::Bool(false).into());
assert_uplc(
src,
constant_true
.clone()
.delayed_if_then_else(constant_true, constant_false),
false,
)
}