diff --git a/crates/aiken-lang/src/gen_uplc.rs b/crates/aiken-lang/src/gen_uplc.rs index 7c133519..07d52f35 100644 --- a/crates/aiken-lang/src/gen_uplc.rs +++ b/crates/aiken-lang/src/gen_uplc.rs @@ -4486,11 +4486,6 @@ impl<'a> CodeGenerator<'a> { DefaultFunction::HeadList if !tipo.is_pair() => { builder::undata_builtin(&func, count, ret_tipo, arg_vec) } - DefaultFunction::MkPairData => { - unimplemented!( - "MkPairData should be handled by an anon function ( a, b, .., z).\n" - ) - } _ => { let mut term: Term = func.into(); diff --git a/crates/aiken-project/src/tests/gen_uplc.rs b/crates/aiken-project/src/tests/gen_uplc.rs index 43957288..1de09053 100644 --- a/crates/aiken-project/src/tests/gen_uplc.rs +++ b/crates/aiken-project/src/tests/gen_uplc.rs @@ -6600,3 +6600,34 @@ fn mk_nil_list_data() { false, ) } + +#[test] +fn mk_pair_data() { + let src = r#" + use aiken/builtin.{i_data} + + test nil_equals() { + builtin.mk_pair_data(i_data(1), i_data(2)).1st == i_data(1) + } + "#; + + assert_uplc( + src, + Term::equals_data() + .apply( + Term::fst_pair().apply( + Term::mk_pair_data() + .apply(Term::Constant( + Constant::Data(Data::integer(1.into())).into(), + )) + .apply(Term::Constant( + Constant::Data(Data::integer(2.into())).into(), + )), + ), + ) + .apply(Term::Constant( + Constant::Data(Data::integer(1.into())).into(), + )), + false, + ) +}