Commit d357f526 authored by David Feuer's avatar David Feuer Committed by David Feuer
Browse files

Shortcut a test in exprIsOk

`exprIsOk` didn't shortcut properly when checking `case` (it used
`foldl` inappropriately). Fix that.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3343
parent e0c433c8
......@@ -1130,8 +1130,8 @@ exprIsOk ok_app e
go _ (Type {}) = True
go _ (Coercion {}) = True
go n (Cast e _) = go n e
go n (Case scrut _ _ alts) = foldl (&&) (ok scrut)
[ go n rhs | (_,_,rhs) <- alts ]
go n (Case scrut _ _ alts) = ok scrut &&
and [ go n rhs | (_,_,rhs) <- alts ]
go n (Tick t e) | tickishCounts t = False
| otherwise = go n e
go n (Lam x e) | isRuntimeVar x = n==0 || go (n-1) e
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment