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/module | |
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/module')
-rw-r--r-- | testsuite/tests/module/mod110.stderr | 11 | ||||
-rw-r--r-- | testsuite/tests/module/mod151.stderr | 11 | ||||
-rw-r--r-- | testsuite/tests/module/mod152.stderr | 11 | ||||
-rw-r--r-- | testsuite/tests/module/mod153.stderr | 11 | ||||
-rw-r--r-- | testsuite/tests/module/mod164.stderr | 17 | ||||
-rw-r--r-- | testsuite/tests/module/mod165.stderr | 10 |
6 files changed, 38 insertions, 33 deletions
diff --git a/testsuite/tests/module/mod110.stderr b/testsuite/tests/module/mod110.stderr index 38e9c79a54..97f7eedadb 100644 --- a/testsuite/tests/module/mod110.stderr +++ b/testsuite/tests/module/mod110.stderr @@ -1,7 +1,8 @@ mod110.hs:11:10: error: [GHC-87543] - Ambiguous occurrence ‘Eq’ - It could refer to either ‘Prelude.Eq’, - imported from ‘Prelude’ at mod110.hs:4:1-14 - (and originally defined in ‘GHC.Classes’) - or ‘M.Eq’, defined at mod110.hs:7:1 + Ambiguous occurrence ‘Eq’. + It could refer to + either ‘Prelude.Eq’, + imported from ‘Prelude’ at mod110.hs:4:1-14 + (and originally defined in ‘GHC.Classes’), + or ‘M.Eq’, defined at mod110.hs:7:1. diff --git a/testsuite/tests/module/mod151.stderr b/testsuite/tests/module/mod151.stderr index 8bb41459fb..ca382a3155 100644 --- a/testsuite/tests/module/mod151.stderr +++ b/testsuite/tests/module/mod151.stderr @@ -1,7 +1,8 @@ mod151.hs:2:20: error: [GHC-87543] - Ambiguous occurrence ‘id’ - It could refer to either ‘Prelude.id’, - imported from ‘Prelude’ at mod151.hs:2:8 - (and originally defined in ‘GHC.Base’) - or ‘M.id’, defined at mod151.hs:2:30 + Ambiguous occurrence ‘id’. + It could refer to + either ‘Prelude.id’, + imported from ‘Prelude’ at mod151.hs:2:8 + (and originally defined in ‘GHC.Base’), + or ‘M.id’, defined at mod151.hs:2:30. diff --git a/testsuite/tests/module/mod152.stderr b/testsuite/tests/module/mod152.stderr index d60269b757..9742ed69ba 100644 --- a/testsuite/tests/module/mod152.stderr +++ b/testsuite/tests/module/mod152.stderr @@ -1,7 +1,8 @@ mod152.hs:2:26: error: [GHC-87543] - Ambiguous occurrence ‘id’ - It could refer to either ‘Prelude.id’, - imported from ‘Prelude’ at mod152.hs:2:8 - (and originally defined in ‘GHC.Base’) - or ‘M.id’, defined at mod152.hs:2:36 + Ambiguous occurrence ‘id’. + It could refer to + either ‘Prelude.id’, + imported from ‘Prelude’ at mod152.hs:2:8 + (and originally defined in ‘GHC.Base’), + or ‘M.id’, defined at mod152.hs:2:36. diff --git a/testsuite/tests/module/mod153.stderr b/testsuite/tests/module/mod153.stderr index 989b27a77e..7d71dbcd0a 100644 --- a/testsuite/tests/module/mod153.stderr +++ b/testsuite/tests/module/mod153.stderr @@ -1,7 +1,8 @@ mod153.hs:2:11: error: [GHC-87543] - Ambiguous occurrence ‘id’ - It could refer to either ‘Prelude.id’, - imported from ‘Prelude’ at mod153.hs:2:8 - (and originally defined in ‘GHC.Base’) - or ‘M.id’, defined at mod153.hs:2:21 + Ambiguous occurrence ‘id’. + It could refer to + either ‘Prelude.id’, + imported from ‘Prelude’ at mod153.hs:2:8 + (and originally defined in ‘GHC.Base’), + or ‘M.id’, defined at mod153.hs:2:21. diff --git a/testsuite/tests/module/mod164.stderr b/testsuite/tests/module/mod164.stderr index d6c0a9eec2..26de35564e 100644 --- a/testsuite/tests/module/mod164.stderr +++ b/testsuite/tests/module/mod164.stderr @@ -1,9 +1,10 @@ -mod164.hs:9:5: [GHC-87543] - Ambiguous occurrence ‘D1’ - It could refer to either ‘Mod164_A.D1’, - imported from ‘Mod164_A’ at mod164.hs:4:1-15 - (and originally defined at Mod164_A.hs:3:10-11) - or ‘Mod164_B.D1’, - imported from ‘Mod164_B’ at mod164.hs:5:1-15 - (and originally defined at Mod164_B.hs:3:10-11) +mod164.hs:9:5: error: [GHC-87543] + Ambiguous occurrence ‘D1’. + It could refer to + either ‘Mod164_A.D1’, + imported from ‘Mod164_A’ at mod164.hs:4:1-15 + (and originally defined at Mod164_A.hs:3:10-11), + or ‘Mod164_B.D1’, + imported from ‘Mod164_B’ at mod164.hs:5:1-15 + (and originally defined at Mod164_B.hs:3:10-11). diff --git a/testsuite/tests/module/mod165.stderr b/testsuite/tests/module/mod165.stderr index 9ef57d4bbd..be092c086e 100644 --- a/testsuite/tests/module/mod165.stderr +++ b/testsuite/tests/module/mod165.stderr @@ -1,7 +1,7 @@ -mod165.hs:9:5: [GHC-87543] - Ambiguous occurrence ‘A.D1’ - It could refer to either ‘A.D1’, - imported from ‘Mod164_A’ at mod165.hs:4:1-20 - or ‘A.D1’, imported from ‘Mod164_B’ at mod165.hs:5:1-20 +mod165.hs:9:5: error: [GHC-87543] + Ambiguous occurrence ‘A.D1’. + It could refer to + either ‘A.D1’, imported from ‘Mod164_A’ at mod165.hs:4:1-20, + or ‘A.D1’, imported from ‘Mod164_B’ at mod165.hs:5:1-20. exit(1) |