Improve spans for error messages
Consider the following program.
test = not (f True True)
f :: Bool -> Bool -> String
f _ _ = ""
The compiler prints the following (correct) error message when trying to compile the program.
1:6-1:24 Error:
Type error in application
not (f True True)
Term: (f True True)
Inferred type: [Prelude.Char]
Expected type: Prelude.Bool
Types Prelude.Bool and [Prelude.Char] are incompatible
|
1 | test = not (f True True)
| ^^^^^^^^^^^^^^^^^^^
However, the highlighted part seems to be a bit off (or at least starting to early).
Edited by Finn Teegen