summaryrefslogtreecommitdiff
path: root/compiler/deSugar
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/deSugar')
-rw-r--r--compiler/deSugar/DsMeta.hs6
-rw-r--r--compiler/deSugar/DsUtils.lhs12
2 files changed, 11 insertions, 7 deletions
diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs
index 405b7687a5..f25039c8a9 100644
--- a/compiler/deSugar/DsMeta.hs
+++ b/compiler/deSugar/DsMeta.hs
@@ -519,9 +519,9 @@ repBangTy ty= do
rep2 strictTypeName [s, t]
where
(str, ty') = case ty of
- L _ (HsBangTy HsUnpack ty) -> (unpackedName, ty)
- L _ (HsBangTy _ ty) -> (isStrictName, ty)
- _ -> (notStrictName, ty)
+ L _ (HsBangTy (HsBang True) ty) -> (unpackedName, ty)
+ L _ (HsBangTy _ ty) -> (isStrictName, ty)
+ _ -> (notStrictName, ty)
-------------------------------------------------------
-- Deriving clause
diff --git a/compiler/deSugar/DsUtils.lhs b/compiler/deSugar/DsUtils.lhs
index 609041ba24..504a76dc86 100644
--- a/compiler/deSugar/DsUtils.lhs
+++ b/compiler/deSugar/DsUtils.lhs
@@ -316,10 +316,14 @@ mkCoAlgCaseMatchResult dflags var ty match_alts
mk_case fail = do alts <- mapM (mk_alt fail) sorted_alts
return (mkWildCase (Var var) (idType var) ty (mk_default fail ++ alts))
- mk_alt fail (con, args, MatchResult _ body_fn) = do
- body <- body_fn fail
- us <- newUniqueSupply
- return (mkReboxingAlt (uniqsFromSupply us) con args body)
+ mk_alt fail (con, args, MatchResult _ body_fn)
+ = do { body <- body_fn fail
+ ; case dataConBoxer con of {
+ Nothing -> return (DataAlt con, args, body) ;
+ Just (DCB boxer) ->
+ do { us <- newUniqueSupply
+ ; let (rep_ids, binds) = initUs_ us (boxer ty_args args)
+ ; return (DataAlt con, rep_ids, mkLets binds body) } } }
mk_default fail | exhaustive_case = []
| otherwise = [(DEFAULT, [], fail)]