Since ghc 8.10 (confirmed with ghc 8.10.4), hint (which I use through mueval) produces duplicate location information in parse errors:
$ mueval -e '+' #ghc 8.8.4
<hint>:1:1: error: parse error on input ‘+’
$ mueval -e '+' #ghc 8.10.4
<hint>:1:1: error: <hint>:1:1: error: parse error on input ‘+’
$ mueval -e '+' #ghc 9.0.1
<hint>:1:1: error: <hint>:1:1: error: parse error on input ‘+’
The extra location is added for the benefit of ghc-8.8 and earlier at
|
GHC.mkLocMessage GHC.SevError src_span msg |
As far as I can see, name resolution and type errors materialise differently (through an exception in the InterpreterT m monad, see runGhcImpl), so it seems to be safe to just remove the added location for ghc >= 8.8 (note that ghc 9.0 is handled separately a few lines earlier).
Since ghc 8.10 (confirmed with ghc 8.10.4),
hint(which I use throughmueval) produces duplicate location information in parse errors:The extra location is added for the benefit of ghc-8.8 and earlier at
hint/src/Hint/InterpreterT.hs
Line 205 in 9524444
As far as I can see, name resolution and type errors materialise differently (through an exception in the
InterpreterT mmonad, seerunGhcImpl), so it seems to be safe to just remove the added location for ghc >= 8.8 (note that ghc 9.0 is handled separately a few lines earlier).