Skip to content

Commit

Permalink
Fix error for #36
Browse files Browse the repository at this point in the history
  • Loading branch information
Feliix42 committed Apr 17, 2019
1 parent 509b247 commit 466d29f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/Ohua/Feature/TailRec/Passes/ALang.hs
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ rewriteCallExpr e = do
falseB' = rewriteBranch falseB
(fixRef, recurVars) =
case (trueB', falseB') of
(Left f, Right bnds) -> (f, bnds)
(Right bnds, Left f) -> error $ "I am sorry, but for now the recursion is required to be on the first (`then`) branch of the final condition. This is a bug of the implementation and will be fixed in the future. (Issue #36)\n\nYour code violating this invariant was\n" <> show (PP.indent 4 $ PP.pretty fullExpr) -- (f, bnds)
(Left f, Right bnds) -> error $ "I am sorry, but for now the recursion is required to be on the first (`then`) branch of the final condition. This is a bug of the implementation and will be fixed in the future. (Issue #36)\n\nYour code violating this invariant was\n" <> show (PP.indent 4 $ PP.pretty fullExpr) -- (f, bnds)
(Right bnds, Left f) -> (f, bnds)
_ -> error "invariant broken"
in fromListToApply (FunRef recurEndMarker Nothing) $
cond : fixRef : recurVars
Expand Down

0 comments on commit 466d29f

Please sign in to comment.