Skip to content

Commit

Permalink
Tidbit
Browse files Browse the repository at this point in the history
  • Loading branch information
msprotz committed Nov 29, 2023
1 parent 4ad7019 commit 2d9db05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Checker.ml
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ and infer' env e =
check env TBool e1;
let t = infer env e2 in
if t = TUnit || t = TAny then
t (* loops that end in return can be typed with TAny *)
TAny (* loops that end in return can be typed with TAny *)
else
checker_error env "%a, while loop is neither tany or tunit" ploc env.location

Expand Down
2 changes: 1 addition & 1 deletion lib/Simplify.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ and hoist_expr loc pos e =
(* We now allow IfThenElse nodes directly under IfThenElse, on the basis
* that the outer IfThenElse is properly positioned under a let-binding.
* let_if_to_assign will know how to deal with this. *)
if pos = UnderStmtLet || pos = UnderConditional then
if pos = UnderStmtLet || pos = UnderConditional || Options.rust () then
lhs1, mk (EIfThenElse (e1, e2, e3))
else
let b, body, cont = mk_named_binding "ite" t (EIfThenElse (e1, e2, e3)) in
Expand Down

0 comments on commit 2d9db05

Please sign in to comment.