diff options
author | sheaf <sam.derbyshire@gmail.com> | 2021-11-19 10:19:19 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-11-20 18:13:23 -0500 |
commit | 742d8b6049c30f3b0cd1704d7a34d865bef41712 (patch) | |
tree | b22ad862ca4db2e9004d8b4ab4aafbc11bcde0a9 /testsuite/tests/ghci | |
parent | bc7e9f038112496c45aeb81d1504e57acb3722c7 (diff) | |
download | haskell-742d8b6049c30f3b0cd1704d7a34d865bef41712.tar.gz |
Include "not more specific" info in overlap msg
When instances overlap, we now include additional information
about why we weren't able to select an instance: perhaps
one instance overlapped another but was not strictly more specific,
so we aren't able to directly choose it.
Fixes #20542
Diffstat (limited to 'testsuite/tests/ghci')
-rw-r--r-- | testsuite/tests/ghci/scripts/T10963.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T15325.stderr | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/testsuite/tests/ghci/scripts/T10963.stderr b/testsuite/tests/ghci/scripts/T10963.stderr index 7082d6e6cf..23b18b29cc 100644 --- a/testsuite/tests/ghci/scripts/T10963.stderr +++ b/testsuite/tests/ghci/scripts/T10963.stderr @@ -3,11 +3,10 @@ • Ambiguous type variable ‘a0’ arising from a use of ‘foo’ prevents the constraint ‘(Num a0)’ from being solved. Probable fix: use a type annotation to specify what ‘a0’ should be. - These potential instances exist: + Potentially matching instances: instance Num Integer -- Defined in ‘GHC.Num’ instance Num Double -- Defined in ‘GHC.Float’ - instance Num Float -- Defined in ‘GHC.Float’ - ...plus N others - ...plus N instances involving out-of-scope types + ...plus three others + ...plus 8 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the expression: foo diff --git a/testsuite/tests/ghci/scripts/T15325.stderr b/testsuite/tests/ghci/scripts/T15325.stderr index 99efb5585e..cd473af4dc 100644 --- a/testsuite/tests/ghci/scripts/T15325.stderr +++ b/testsuite/tests/ghci/scripts/T15325.stderr @@ -8,11 +8,10 @@ T15325.hs:11:9: warning: [-Wdeferred-type-errors (in -Wdefault)] • Ambiguous type variable ‘e0’ arising from the literal ‘0’ prevents the constraint ‘(Num e0)’ from being solved. Probable fix: use a type annotation to specify what ‘e0’ should be. - These potential instances exist: + Potentially matching instances: instance Num Integer -- Defined in ‘GHC.Num’ instance Num Double -- Defined in ‘GHC.Float’ - instance Num Float -- Defined in ‘GHC.Float’ - ...plus N others + ...plus three others ...plus one instance involving out-of-scope types (use -fprint-potential-instances to see them all) • In the first argument of ‘f’, namely ‘0’ |