Inline now handles (if cond then body else error) patterns.

This allows conditions like ```expect x == 1``` to match performance with ```x == 1 && ...```

Also change builtins forcing to accommodate the new case-constr apply optimization
This commit is contained in:
microproofs
2025-01-09 15:41:47 +07:00
parent c130796f49
commit 19b4b9df0f
4 changed files with 298 additions and 127 deletions

View File

@@ -217,9 +217,11 @@ impl<'a> CodeGenerator<'a> {
fn finalize(&mut self, mut term: Term<Name>) -> Program<Name> {
term = self.special_functions.apply_used_functions(term);
println!("PROG BEFORE IS {}", term.to_pretty());
let program = aiken_optimize_and_intern(self.new_program(term));
println!("PROG IS {}", program.to_pretty());
// This is very important to call here.
// If this isn't done, re-using the same instance
// of the generator will result in free unique errors