hint icon indicating copy to clipboard operation
hint copied to clipboard

duplicate location in error messages since ghc-8.10

Open int-e opened this issue 4 years ago • 0 comments

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 https://github.com/haskell-hint/hint/blob/9524444c0e93c8c7c8b6399a7308272efdadb0b0/src/Hint/InterpreterT.hs#L205

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).

int-e avatar May 18 '21 17:05 int-e