jyp / dante

391 stars 52 forks source link

Clean up temporary file names in error message body #130

Closed sergv closed 5 years ago

sergv commented 5 years ago

Sometimes error message contain paths to the file being checked, e.g. /tmp/tmp/Tests.hs within

error: [-Wdeferred-type-errors]
    • Occurs check: cannot construct the infinite type: t ~ t -> Int
    • In the first argument of ‘d’, namely ‘d’
      In the second argument of ‘(*)’, namely ‘d d’
      In the second argument of ‘(+)’, namely ‘c * d d’
    • Relevant bindings include
        d :: t -> Int (bound at /tmp/tmp/Test.hs:33:14)
        go :: Int -> Int -> Int -> (t -> Int) -> Int
          (bound at /tmp/tmp/Test.hs:33:5)

I think it's good idea to have the paths point to the original file rather than a temporary one.