summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-01-31 16:20:09 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2022-02-01 10:34:34 +0000
commitc5663a9a0ee64958634fcb24cebd745a50c38413 (patch)
tree2aaae6470e1a90a543d2407a27763f4ce136d090 /compiler
parent584f03faed67c59895c90900ededb715a1a62528 (diff)
downloadhaskell-wip/tidy-implic-mp.tar.gz
Make implication tidying agree with Note [Tidying multiple names at once]wip/tidy-implic-mp
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')
-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 2901078004..a6e8b4b477 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)