Error messages about fundep conflicts are missing spans
Consider
{-# LANGUAGE FunctionalDependencies #-}
class Convert a b | a -> b where
convert :: a -> b
instance Convert Int Float where
convert = fromIntegral
instance Convert Int () where
convert = const ()
The Curry frontend currently outputs an error message without a span:
Error:
Functional dependency conflict between instances
Convert Int () (defined in FunDepConflict)
Convert Int Float (defined in FunDepConflict)
GHC, however, does:
FunDepConflict.hs:6:10: error: [GHC-46208]
Functional dependencies conflict between instance declarations:
instance Convert Int Float -- Defined at FunDepConflict.hs:6:10
instance Convert Int () -- Defined at FunDepConflict.hs:9:10
|
6 | instance Convert Int Float where
| ^^^^^^^^^^^^^^^^^
It would be nice if we could add spans to our error message too, that way the message can also be positioned correctly in LSP clients.