summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename/Splice.hs
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-02-14 15:34:56 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-04 23:14:01 -0500
commitdb898c8a33813f4bdfbd38fe7595fbdd819c172a (patch)
treebd6a3a1c90a0af3d6cee1b80c44b5c367692ca74 /compiler/GHC/Rename/Splice.hs
parentf943edb0c40d20e1330450c3e148b8d0c877eded (diff)
downloadhaskell-db898c8a33813f4bdfbd38fe7595fbdd819c172a.tar.gz
Add a Template Haskell warning flag -Wimplicit-lift
Part of #17804.
Diffstat (limited to 'compiler/GHC/Rename/Splice.hs')
-rw-r--r--compiler/GHC/Rename/Splice.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/GHC/Rename/Splice.hs b/compiler/GHC/Rename/Splice.hs
index 885fdf17fd..605da448ce 100644
--- a/compiler/GHC/Rename/Splice.hs
+++ b/compiler/GHC/Rename/Splice.hs
@@ -909,6 +909,12 @@ check_cross_stage_lifting top_lvl name ps_var
; let lift_expr = nlHsApp (nlHsVar liftName) (nlHsVar name)
pend_splice = PendingRnSplice UntypedExpSplice name lift_expr
+ -- Warning for implicit lift (#17804)
+ ; whenWOptM Opt_WarnImplicitLift $
+ addWarnTc (Reason Opt_WarnImplicitLift)
+ (text "The variable" <+> quotes (ppr name) <+>
+ text "is implicitly lifted in the TH quotation")
+
-- Update the pending splices
; ps <- readMutVar ps_var
; writeMutVar ps_var (pend_splice : ps) }