Skip to content

duplicate location in error messages since ghc-8.10 #132

@int-e

Description

@int-e

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions