summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/GHC/Core/Lint.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Lint.hs b/compiler/GHC/Core/Lint.hs
index 688b63ff55..32d109b2f1 100644
--- a/compiler/GHC/Core/Lint.hs
+++ b/compiler/GHC/Core/Lint.hs
@@ -945,7 +945,17 @@ lintCoreExpr e@(App _ _)
; checkCanEtaExpand fun args app_ty
; return app_pair}
where
- (fun, args) = collectArgs e
+ (fun, args, _source_ticks) = collectArgsTicks tickishFloatable e
+ -- We must look through source ticks to avoid #21152, for example:
+ --
+ -- reallyUnsafePtrEquality
+ -- = \ @a ->
+ -- (src<loc> reallyUnsafePtrEquality#)
+ -- @Lifted @a @Lifted @a
+ --
+ -- To do this, we use `collectArgsTicks tickishFloatable` to match
+ -- the eta expansion behaviour, as per Note [Eta expansion and source notes]
+ -- in GHC.Core.Opt.Arity.
lintCoreExpr (Lam var expr)
= markAllJoinsBad $