fix: need to sort record update args so they match indices order

This commit is contained in:
microproofs 2023-05-30 20:17:31 -04:00 committed by Kasey
parent 52a51acc69
commit c710d488d6
1 changed files with 4 additions and 2 deletions

View File

@ -206,7 +206,6 @@ impl<'a> CodeGenerator<'a> {
version: (1, 0, 0), version: (1, 0, 0),
term, term,
}; };
program = aiken_optimize_and_intern(program); program = aiken_optimize_and_intern(program);
// This is very important to call here. // This is very important to call here.
@ -715,7 +714,10 @@ impl<'a> CodeGenerator<'a> {
self.build(spread, &mut update_stack); self.build(spread, &mut update_stack);
for arg in args { for arg in args
.iter()
.sorted_by(|arg1, arg2| arg1.index.cmp(&arg2.index))
{
let mut arg_stack = update_stack.empty_with_scope(); let mut arg_stack = update_stack.empty_with_scope();
self.build(&arg.value, &mut arg_stack); self.build(&arg.value, &mut arg_stack);