summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsUtils.lhs
diff options
context:
space:
mode:
authorDimitrios Vytiniotis <dimitris@microsoft.com>2011-11-16 15:28:43 +0000
committerDimitrios Vytiniotis <dimitris@microsoft.com>2011-11-16 15:28:43 +0000
commit7ec5404a3fd277251a1ab353aa398adfc02b6d34 (patch)
tree78ff33800fad55d7dbb4e1b1732d4f82c4e092a2 /compiler/deSugar/DsUtils.lhs
parentdb892577a2effc2266533e355dad2c40f9fd3be1 (diff)
parent1bbb89f3ab009367fcca84b73b351ddcf5be16a4 (diff)
downloadhaskell-ghc-constraint-solver.tar.gz
Merge branch 'master' of http://darcs.haskell.org/ghc into ghc-constraint-solverghc-constraint-solver
Diffstat (limited to 'compiler/deSugar/DsUtils.lhs')
-rw-r--r--compiler/deSugar/DsUtils.lhs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/deSugar/DsUtils.lhs b/compiler/deSugar/DsUtils.lhs
index 6a46bbe93d..626b6ee795 100644
--- a/compiler/deSugar/DsUtils.lhs
+++ b/compiler/deSugar/DsUtils.lhs
@@ -291,7 +291,7 @@ mkGuardedMatchResult pred_expr (MatchResult _ body_fn)
mkCoPrimCaseMatchResult :: Id -- Scrutinee
-> Type -- Type of the case
-> [(Literal, MatchResult)] -- Alternatives
- -> MatchResult
+ -> MatchResult -- Literals are all unlifted
mkCoPrimCaseMatchResult var ty match_alts
= MatchResult CanFail mk_case
where
@@ -300,8 +300,10 @@ mkCoPrimCaseMatchResult var ty match_alts
return (Case (Var var) var ty ((DEFAULT, [], fail) : alts))
sorted_alts = sortWith fst match_alts -- Right order for a Case
- mk_alt fail (lit, MatchResult _ body_fn) = do body <- body_fn fail
- return (LitAlt lit, [], body)
+ mk_alt fail (lit, MatchResult _ body_fn)
+ = ASSERT( not (litIsLifted lit) )
+ do body <- body_fn fail
+ return (LitAlt lit, [], body)
mkCoAlgCaseMatchResult