From 018453f6b10414f9fe46ec0afe21181b490c29af Mon Sep 17 00:00:00 2001 From: microproofs Date: Fri, 28 Jul 2023 13:00:52 -0400 Subject: [PATCH] fix expect on tuple type using the wrong internal type --- crates/aiken-lang/src/gen_uplc.rs | 2 +- crates/aiken-project/src/tests/gen_uplc.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/aiken-lang/src/gen_uplc.rs b/crates/aiken-lang/src/gen_uplc.rs index ae5f64da..179644f7 100644 --- a/crates/aiken-lang/src/gen_uplc.rs +++ b/crates/aiken-lang/src/gen_uplc.rs @@ -1302,7 +1302,7 @@ impl<'a> CodeGenerator<'a> { ); let expect_tuple_item = self.expect_type_assign( - tipo, + arg, AirTree::local_var(&tuple_index_name, arg.clone()), defined_data_types, location, diff --git a/crates/aiken-project/src/tests/gen_uplc.rs b/crates/aiken-project/src/tests/gen_uplc.rs index 8e33e40f..c546153d 100644 --- a/crates/aiken-project/src/tests/gen_uplc.rs +++ b/crates/aiken-project/src/tests/gen_uplc.rs @@ -71,7 +71,7 @@ fn assert_uplc(source_code: &str, expected: Term, should_fail: bool) { version: (1, 0, 0), term: expected, }; - + let expected = optimize::aiken_optimize_and_intern(expected); // println!("expected: {}", expected.to_pretty()); @@ -102,7 +102,6 @@ fn assert_uplc(source_code: &str, expected: Term, should_fail: bool) { term: expected, }; - let expected = optimize::aiken_optimize_and_intern(expected); let expected: Program = expected.try_into().unwrap(); @@ -3026,7 +3025,7 @@ fn when_tuple_deconstruction() { ) .apply(Term::var("dat")), ), - ) + ) .lambda("ctx") .lambda("red") .lambda("dat") @@ -3770,8 +3769,7 @@ fn list_fields_unwrap() { .lambda("item_1_fields") .apply(Term::var(CONSTR_FIELDS_EXPOSER).apply(Term::var("item_1"))) .lambda("item_1") - .apply(Term::head_list().apply(Term::var("field_list"))) - + .apply(Term::head_list().apply(Term::var("field_list"))), ) .lambda("field_list") .apply(Term::list_values(vec![ @@ -4210,7 +4208,9 @@ fn expect_head_cast_data_with_tail() { ) .apply(Term::var("tail_2")) .apply( - Term::un_i_data().apply(Term::var("list_item")).lambda("list_item") + Term::un_i_data() + .apply(Term::var("list_item")) + .lambda("list_item"), ), ) .lambda("tail_2")