summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Utils/Monad.hs
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2022-04-07 19:03:05 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-04-08 09:43:35 -0400
commit777365f18233d7ad032435ea2c93197cbb1d732e (patch)
tree059563b83d3ad3270a913cc834dfbbe8e2851e5d /compiler/GHC/Tc/Utils/Monad.hs
parentc44432db254d2fc960d7864e080cb50e65dfa7c6 (diff)
downloadhaskell-777365f18233d7ad032435ea2c93197cbb1d732e.tar.gz
Correctly report SrcLoc of redundant constraints
We were accidentally dropping the source location information in certain circumstances when reporting redundant constraints. This patch makes sure that we set the TcLclEnv correctly before reporting the warning. Fixes #21315
Diffstat (limited to 'compiler/GHC/Tc/Utils/Monad.hs')
-rw-r--r--compiler/GHC/Tc/Utils/Monad.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Tc/Utils/Monad.hs b/compiler/GHC/Tc/Utils/Monad.hs
index 75d6491bad..dada2c8041 100644
--- a/compiler/GHC/Tc/Utils/Monad.hs
+++ b/compiler/GHC/Tc/Utils/Monad.hs
@@ -536,7 +536,7 @@ The `tcRnSrcDecls` extends the environments in `gbl_env` and `lcl_env`
which we then want to be in scope in `more stuff`.
The problem is that `lcl_env :: TcLclEnv` has an IORef for error
-messages `tcl_errs`, and another for constraints (`tcl_lie`),a and
+messages `tcl_errs`, and another for constraints (`tcl_lie`), and
another for Linear Haskell usage information (`tcl_usage`). Now
suppose we change it a tiny bit
do { (gbl_env, lcl_env) <- checkNoErrs $