summaryrefslogtreecommitdiff
path: root/compiler/coreSyn/CoreUtils.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2019-11-01 17:26:12 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2019-11-01 17:26:47 +0000
commit8c40e3f98649d6d3310a1181add7d2af6f6b7c87 (patch)
tree6e43ac2cf1df40df629560fb39e83ab5ee632bda /compiler/coreSyn/CoreUtils.hs
parentb0102bcf850edb63b8d88c11361f54bda3fe2417 (diff)
downloadhaskell-wip/inline-compulsory.tar.gz
Diffstat (limited to 'compiler/coreSyn/CoreUtils.hs')
-rw-r--r--compiler/coreSyn/CoreUtils.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs
index 1ca5a6b438..342ad414f9 100644
--- a/compiler/coreSyn/CoreUtils.hs
+++ b/compiler/coreSyn/CoreUtils.hs
@@ -495,7 +495,9 @@ bindNonRec bndr rhs body
-- | Tests whether we have to use a @case@ rather than @let@ binding for this expression
-- as per the invariants of 'CoreExpr': see "CoreSyn#let_app_invariant"
needsCaseBinding :: Type -> CoreExpr -> Bool
-needsCaseBinding ty rhs = isUnliftedType ty && not (exprOkForSpeculation rhs)
+needsCaseBinding ty rhs
+ = not (isLiftedType_maybe ty `orElse` True)
+ && not (exprOkForSpeculation rhs)
-- Make a case expression instead of a let
-- These can arise either from the desugarer,
-- or from beta reductions: (\x.e) (x +# y)