summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-09-26 14:52:26 -0400
committerBen Gamari <ben@smart-cactus.org>2017-09-26 17:40:03 -0400
commit018c40fb1bb27853d0cefa5b90a44ce13e91a856 (patch)
treeb76d4e1b419200d6ea296384ac0e8bcb13580a10 /compiler
parent8f468fe05cf81ca516b3a8cf66792f842dbfcf40 (diff)
downloadhaskell-018c40fb1bb27853d0cefa5b90a44ce13e91a856.tar.gz
desugar: Catch levity polymorphism in unboxed sum expressions
Fixes #13929.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/deSugar/DsExpr.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/deSugar/DsExpr.hs b/compiler/deSugar/DsExpr.hs
index 1ed45fcde2..b2b98f8fc9 100644
--- a/compiler/deSugar/DsExpr.hs
+++ b/compiler/deSugar/DsExpr.hs
@@ -379,11 +379,11 @@ ds_expr _ (ExplicitTuple tup_args boxity)
mkCoreTupBoxity boxity args) }
ds_expr _ (ExplicitSum alt arity expr types)
- = do { core_expr <- dsLExpr expr
- ; return $ mkCoreConApps (sumDataCon alt arity)
- (map (Type . getRuntimeRep) types ++
- map Type types ++
- [core_expr]) }
+ = do { dsWhenNoErrs (dsLExprNoLP expr)
+ (\core_expr -> mkCoreConApps (sumDataCon alt arity)
+ (map (Type . getRuntimeRep) types ++
+ map Type types ++
+ [core_expr]) ) }
ds_expr _ (HsSCC _ cc expr@(L loc _)) = do
dflags <- getDynFlags