summaryrefslogtreecommitdiff
path: root/compiler/deSugar/Check.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/deSugar/Check.hs')
-rw-r--r--compiler/deSugar/Check.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs
index e87eb39d26..4a27d485c0 100644
--- a/compiler/deSugar/Check.hs
+++ b/compiler/deSugar/Check.hs
@@ -43,6 +43,7 @@ import FastString
import DataCon
import PatSyn
import HscTypes (CompleteMatch(..))
+import BasicTypes (Boxity(..))
import DsMonad
import TcSimplify (tcCheckSatisfiability)
@@ -1078,12 +1079,17 @@ translatePat fam_insts pat = case pat of
TuplePat tys ps boxity -> do
tidy_ps <- translatePatVec fam_insts (map unLoc ps)
let tuple_con = RealDataCon (tupleDataCon boxity (length ps))
- return [vanillaConPattern tuple_con tys (concat tidy_ps)]
+ tys' = case boxity of
+ Boxed -> tys
+ -- See Note [Unboxed tuple RuntimeRep vars] in TyCon
+ Unboxed -> map getRuntimeRep tys ++ tys
+ return [vanillaConPattern tuple_con tys' (concat tidy_ps)]
SumPat ty p alt arity -> do
tidy_p <- translatePat fam_insts (unLoc p)
let sum_con = RealDataCon (sumDataCon alt arity)
- return [vanillaConPattern sum_con ty tidy_p]
+ -- See Note [Unboxed tuple RuntimeRep vars] in TyCon
+ return [vanillaConPattern sum_con (map getRuntimeRep ty ++ ty) tidy_p]
-- --------------------------------------------------------------------------
-- Not supposed to happen