Skip to content

Commit

Permalink
Merge pull request #1056 from hacspec/fix-1044
Browse files Browse the repository at this point in the history
fix(engine) Avoid wrapping return in a tuple.
  • Loading branch information
W95Psp authored Oct 29, 2024
2 parents 5b781f6 + 1875175 commit d9c5568
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion engine/lib/phases/phase_local_mutation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ struct
span = expr.span;
typ = local_vars_expr.typ;
}
| Return { e; witness } ->
{
e = Return { e = dexpr e; witness };
span = expr.span;
typ = dty expr.span expr.typ;
}
| Continue { acc = None; label; witness; _ } ->
let w = Features.On.state_passing_loop in
let e = local_vars_expr in
Expand Down Expand Up @@ -354,7 +360,8 @@ struct
}
else loop
| [%inline_arms
"dexpr'.*" - Let - Assign - Closure - Loop - If - Match - Break] ->
"dexpr'.*" - Let - Assign - Closure - Loop - If - Match - Break
- Return] ->
map (fun e ->
let e' =
B.{ e; typ = dty expr.span expr.typ; span = expr.span }
Expand Down

0 comments on commit d9c5568

Please sign in to comment.