summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsExpr.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-12-13 10:46:26 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2017-12-13 10:52:10 +0000
commite40db7b1676627f5291b463405338e7b69fa3f69 (patch)
tree8426bae8d6097dcd89fc55282c0167bae33b12b9 /compiler/deSugar/DsExpr.hs
parenta106a200892e2ac7953f0929c303d392c8808f89 (diff)
downloadhaskell-e40db7b1676627f5291b463405338e7b69fa3f69.tar.gz
Detect levity-polymorphic uses of unsafeCoerce#
This bug was shown up by Trac #14561. The deguarer carefully detects unsaturated and levity-polymorphic uses of primops, but not of things like unsafeCoerce#. The fix is simple: see Note [Levity-polymorphic Ids] in Id.
Diffstat (limited to 'compiler/deSugar/DsExpr.hs')
-rw-r--r--compiler/deSugar/DsExpr.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/deSugar/DsExpr.hs b/compiler/deSugar/DsExpr.hs
index 635a9c6137..2f3739e4c2 100644
--- a/compiler/deSugar/DsExpr.hs
+++ b/compiler/deSugar/DsExpr.hs
@@ -260,7 +260,8 @@ ds_expr _ (HsLit lit) = dsLit (convertLit lit)
ds_expr _ (HsOverLit lit) = dsOverLit lit
ds_expr _ (HsWrap co_fn e)
- = do { e' <- ds_expr True e
+ = do { e' <- ds_expr True e -- This is the one place where we recurse to
+ -- ds_expr (passing True), rather than dsExpr
; wrap' <- dsHsWrapper co_fn
; dflags <- getDynFlags
; let wrapped_e = wrap' e'