diff options
author | David Feuer <david.feuer@gmail.com> | 2017-03-14 16:43:37 -0400 |
---|---|---|
committer | David Feuer <David.Feuer@gmail.com> | 2017-03-14 16:43:39 -0400 |
commit | d357f526582e3c4cd4fbda5d73695fc81121b69a (patch) | |
tree | e395214e39590e66376141887e22828a902efd6c | |
parent | e0c433c81182c934ee4c4cc5c6cf25a1b6fb8d83 (diff) | |
download | haskell-d357f526582e3c4cd4fbda5d73695fc81121b69a.tar.gz |
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
-rw-r--r-- | compiler/coreSyn/CoreUtils.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index dce7ef9aaf..3dfb52fcef 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -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 |