Skip to content

Provide spans in error messages about fundeps

Fredrik Wieczerkowski requested to merge fundeps-conflict-message-location into master

Fixes #147 (closed)

This PR adds span infos to InstInfo (and InstMatchInfo). These are populated when binding local instances1 and later passed to the corresponding error message, which now looks as follows:

FunDepConflict.curry:9:1-10:20 Error:
    Functional dependency conflict between instances
      Convert Int () (defined in FunDepConflict)
      Convert Int Float (defined in FunDepConflict)
    | 
  9 | instance Convert Int () where
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
  1. Imported instances will still get NoSpanInfo for now, if we figure out a nice way of ideally finding the origin spans we could add those too.

Merge request reports

Loading