summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Errors.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-01-31 16:20:09 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-02-05 19:22:25 -0500
commit549292eb3725eca61722ddd2cfb4d964ccba3fc7 (patch)
tree302c5e889a1474c8910a06897b306357b6bd704a /compiler/GHC/Tc/Errors.hs
parent299acff08aa1b7b720ad2b69c459c514033bc395 (diff)
downloadhaskell-549292eb3725eca61722ddd2cfb4d964ccba3fc7.tar.gz
Make implication tidying agree with Note [Tidying multiple names at once]
Note [Tidying multiple names at once] indicates that if multiple variables have the same name then we shouldn't prioritise one of them and instead rename them all to a1, a2, a3... etc This patch implements that change, some error message changes as expected. Closes #20932
Diffstat (limited to 'compiler/GHC/Tc/Errors.hs')
-rw-r--r--compiler/GHC/Tc/Errors.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Tc/Errors.hs b/compiler/GHC/Tc/Errors.hs
index 12576437e2..3474626289 100644
--- a/compiler/GHC/Tc/Errors.hs
+++ b/compiler/GHC/Tc/Errors.hs
@@ -82,7 +82,7 @@ import Control.Monad ( unless, when, foldM, forM_ )
import Data.Foldable ( toList )
import Data.Functor ( (<&>) )
import Data.Function ( on )
-import Data.List ( partition, mapAccumL, sort )
+import Data.List ( partition, sort )
import Data.List.NonEmpty ( NonEmpty(..), (<|) )
import qualified Data.List.NonEmpty as NE ( map, reverse )
import Data.List ( sortBy )
@@ -357,7 +357,7 @@ reportImplic ctxt implic@(Implic { ic_skols = tvs
warnRedundantConstraints ctxt' tcl_env info' dead_givens }
where
insoluble = isInsolubleStatus status
- (env1, tvs') = mapAccumL tidyVarBndr (cec_tidy ctxt) $
+ (env1, tvs') = tidyVarBndrs (cec_tidy ctxt) $
scopedSort tvs
-- scopedSort: the ic_skols may not be in dependency order
-- (see Note [Skolems in an implication] in GHC.Tc.Types.Constraint)