Skip to content

Commit

Permalink
Fix test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroProofs committed Oct 29, 2024
1 parent e33bd2a commit ce560b2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 1 addition & 3 deletions crates/aiken-lang/src/gen_uplc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4639,9 +4639,7 @@ impl<'a> CodeGenerator<'a> {
.apply(Term::var(subject_name)),
};

condition
.delay_true_if_then_else(body, other_clauses)
.force()
condition.delay_true_if_then_else(body, other_clauses)
};

if complex_clause {
Expand Down
12 changes: 9 additions & 3 deletions crates/aiken-lang/src/gen_uplc/decision_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use itertools::{Itertools, Position};

use crate::{
ast::{DataTypeKey, Pattern, TypedClause, TypedDataType, TypedPattern},
expr::{lookup_data_type_by_tipo, Type, TypedExpr},
expr::{lookup_data_type_by_tipo, Type, TypeVar, TypedExpr},
};

use super::{interner::AirInterner, tree::AirTree};
Expand Down Expand Up @@ -1041,7 +1041,7 @@ impl<'a, 'b> TreeGen<'a, 'b> {
PAIR_NEW_COLUMNS
} else if current_tipo.is_tuple() {
let Type::Tuple { elems, .. } = current_tipo.as_ref() else {
unreachable!()
unreachable!("{:#?}", current_tipo)
};
elems.len()
} else if let Some(data) = lookup_data_type_by_tipo(self.data_types, subject_tipo) {
Expand Down Expand Up @@ -1206,7 +1206,13 @@ pub fn get_tipo_by_path(mut subject_tipo: Rc<Type>, mut path: &[Path]) -> Rc<Typ

path = rest
}
subject_tipo
match subject_tipo.as_ref() {
Type::Var { tipo, .. } => match &*tipo.borrow() {
TypeVar::Unbound { .. } | TypeVar::Generic { .. } => subject_tipo.clone(),
TypeVar::Link { tipo } => get_tipo_by_path(tipo.clone(), &[]),
},
_ => subject_tipo,
}
}

fn match_wild_card(pattern: &TypedPattern) -> bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ description: "Code:\n\npub type Foo<a> {\n Empty\n Bar(a, Foo<a>)\n}\n\npub fn
}
}
],
"compiledCode": "5901d501010032323232323222323232323253330083002300937540062a666010600460126ea801052000001001132323232533300b3004300c375400c2646464a66601c600e601e6ea80284c8cdc019b80003375a60260026600c0046026602800260206ea8028010c044c048008dd6980800098069baa006001132533300b3005300c375400c2a666016600860186ea801c4c8cdc01bad3010001330034c103d879800030103011001300d375400e00200226466e00dd698078009980118079808000a60103d8798000300c375400a600200244464646464a66601e601260206ea800854ccc03cc024c040dd50018a4000002002264a66601e601060206ea80084c8c8c94ccc048c02cc04cdd500309919b80337000066eb4c05c004ccc02c02c008c05cc060004c050dd5003002180a980b0011bad301400130113754004002264a66601e601260206ea800854ccc03cc020c040dd500189919b80375a6028002666010010980103d8798000301430150013011375400600200226466e00dd698098009998038039809980a000a60103d8798000301037540026022004602060220026601c0046601c00297ae0370e90011b8748000c024008c020c024004cc018008cc0180052f5c0ae6955ceaab9e5740ae855d101",
"hash": "46254b889c878fb25e55ad7e9eb3d331770a55defec65749c9504581",
"compiledCode": "59017d0101003232323232322232323232325333008300430093754002264a666012600a60146ea800452000132337006eb4c038004cc011300103d8798000300e300f001300b37540026018601a00a264a66601266e1d2002300a37540022646466e00cdc01bad300f002375a601e0026600a601e6020004601e602000260186ea8008c02cdd500109919b80375a601c00266008601c601e002980103d8798000300b37540046018601a00a601600860020024446464a666014600c60166ea80044c94ccc02cc01cc030dd50008a400026466e00dd69808000999803803a60103d879800030103011001300d3754002601c601e004264a66601666e1d2002300c37540022646466e00cdc01bad3011002375a60220026660100106022602400460226024002601c6ea8008c034dd500109919b80375a602000266600e00e60206022002980103d8798000300d3754004601c601e004601a002660160046601600297ae0370e90001980300119803000a5eb815cd2ab9d5573cae815d0aba201",
"hash": "c6af3f04e300cb8c1d0429cc0d8e56a0413eef9fcb338f72076b426c",
"definitions": {
"Int": {
"dataType": "integer"
Expand Down

0 comments on commit ce560b2

Please sign in to comment.