diff options
author | sheaf <sam.derbyshire@gmail.com> | 2023-05-15 11:06:20 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-05-15 14:49:17 -0400 |
commit | 5ae81842d36a6091b406bfce98c60e8a7fa24240 (patch) | |
tree | 97055026d85f6ee1ff9fbdd51a89ec7dae6509d1 /testsuite/tests/overloadedrecflds/ghci/GHCiDRF.stdout | |
parent | e305e60cf507808fa31c456ef98295f8f7d00c9d (diff) | |
download | haskell-5ae81842d36a6091b406bfce98c60e8a7fa24240.tar.gz |
Improve "ambiguous occurrence" error messages
This error was sometimes a bit confusing, especially when data families
were involved. This commit improves the general presentation of the
"ambiguous occurrence" error, and adds a bit of extra context in the
case of data families.
Fixes #23301
Diffstat (limited to 'testsuite/tests/overloadedrecflds/ghci/GHCiDRF.stdout')
-rw-r--r-- | testsuite/tests/overloadedrecflds/ghci/GHCiDRF.stdout | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/testsuite/tests/overloadedrecflds/ghci/GHCiDRF.stdout b/testsuite/tests/overloadedrecflds/ghci/GHCiDRF.stdout index 4d4e5817d9..f68331068f 100644 --- a/testsuite/tests/overloadedrecflds/ghci/GHCiDRF.stdout +++ b/testsuite/tests/overloadedrecflds/ghci/GHCiDRF.stdout @@ -1,10 +1,10 @@ GHCiDRF.foo :: T -> Int <interactive>:1:1: error: [GHC-87543] - Ambiguous occurrence ‘GHCiDRF.bar’ + Ambiguous occurrence ‘GHCiDRF.bar’. It could refer to - either the field ‘bar’ of record ‘T’, defined at GHCiDRF.hs:3:28 - or the field ‘bar’ of record ‘U’, defined at GHCiDRF.hs:4:16 + either the field ‘bar’ of record ‘T’, defined at GHCiDRF.hs:3:28, + or the field ‘bar’ of record ‘U’, defined at GHCiDRF.hs:4:16. type T :: * data T = MkT {foo :: Int, ...} -- Defined at GHCiDRF.hs:3:16 @@ -18,14 +18,14 @@ data U = MkU {bar :: Bool} GHCiDRF.foo :: GHCiDRF.T -> Int <interactive>:1:1: error: [GHC-87543] - Ambiguous occurrence ‘GHCiDRF.bar’ + Ambiguous occurrence ‘GHCiDRF.bar’. It could refer to - either the field ‘bar’, + either the field ‘bar’ belonging to data constructor ‘MkT’, imported qualified from ‘GHCiDRF’ - (and originally defined at GHCiDRF.hs:3:28-30) - or the field ‘bar’, + (and originally defined at GHCiDRF.hs:3:28-30), + or the field ‘bar’ belonging to data constructor ‘MkU’, imported qualified from ‘GHCiDRF’ - (and originally defined at GHCiDRF.hs:4:16-18) + (and originally defined at GHCiDRF.hs:4:16-18). type GHCiDRF.T :: * data GHCiDRF.T = GHCiDRF.MkT {GHCiDRF.foo :: Int, ...} -- Defined at GHCiDRF.hs:3:16 @@ -38,11 +38,11 @@ data GHCiDRF.U = GHCiDRF.MkU {GHCiDRF.bar :: Bool} -- Defined at GHCiDRF.hs:4:16 <interactive>:11:1: error: [GHC-87543] - Ambiguous occurrence ‘GHCiDRF.bar’ + Ambiguous occurrence ‘GHCiDRF.bar’. It could refer to - either the field ‘bar’, + either the field ‘bar’ belonging to data constructor ‘MkT’, imported qualified from ‘GHCiDRF’ - (and originally defined at GHCiDRF.hs:3:28-30) - or the field ‘bar’, + (and originally defined at GHCiDRF.hs:3:28-30), + or the field ‘bar’ belonging to data constructor ‘MkU’, imported qualified from ‘GHCiDRF’ - (and originally defined at GHCiDRF.hs:4:16-18) + (and originally defined at GHCiDRF.hs:4:16-18). |