diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-09-02 14:05:36 +0200 |
---|---|---|
committer | Ben Gamari <bgamari.foss@gmail.com> | 2015-09-02 09:11:51 -0400 |
commit | 28ac9d31bcabeb44496c0e1750563f3091c62da9 (patch) | |
tree | 427a29e1beca0ee3fee7a1bc825bb5fa2fa03dae /testsuite/tests/overloadedlists | |
parent | c8f623e305ec0a51ac2406a1f754d244e05b96f5 (diff) | |
download | haskell-28ac9d31bcabeb44496c0e1750563f3091c62da9.tar.gz |
Improve the error messages for class instance errors
Summary: See Note [Displaying potential instances].
Reviewers: austin
Subscribers: KaneTW, thomie
Differential Revision: https://phabricator.haskell.org/D1176
Diffstat (limited to 'testsuite/tests/overloadedlists')
-rw-r--r-- | testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr | 68 |
1 files changed, 35 insertions, 33 deletions
diff --git a/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr b/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr index 52658fdd07..79b78658b3 100644 --- a/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr +++ b/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr @@ -1,33 +1,35 @@ -
-overloadedlistsfail01.hs:5:8:
- No instance for (Show a0) arising from a use of ‘print’
- The type variable ‘a0’ is ambiguous
- Note: there are several potential instances:
- instance [safe] Show Version -- Defined in ‘Data.Version’
- instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’
- instance Show Ordering -- Defined in ‘GHC.Show’
- ...plus 23 others
- In the expression: print [1]
- In an equation for ‘main’: main = print [1]
-
-overloadedlistsfail01.hs:5:14:
- No instance for (IsList a0) arising from an overloaded list
- The type variable ‘a0’ is ambiguous
- Note: there are several potential instances:
- instance IsList Version -- Defined in ‘GHC.Exts’
- instance IsList [a] -- Defined in ‘GHC.Exts’
- In the first argument of ‘print’, namely ‘[1]’
- In the expression: print [1]
- In an equation for ‘main’: main = print [1]
-
-overloadedlistsfail01.hs:5:15:
- No instance for (Num (Item a0)) arising from the literal ‘1’
- The type variable ‘a0’ is ambiguous
- Note: there are several potential instances:
- instance Num Integer -- Defined in ‘GHC.Num’
- instance Num Double -- Defined in ‘GHC.Float’
- instance Num Float -- Defined in ‘GHC.Float’
- ...plus two others
- In the expression: 1
- In the first argument of ‘print’, namely ‘[1]’
- In the expression: print [1]
+ +overloadedlistsfail01.hs:5:8: error: + No instance for (Show a0) arising from a use of ‘print’ + The type variable ‘a0’ is ambiguous + Potential instances: + instance [safe] Show Version -- Defined in ‘Data.Version’ + instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ + instance Show Ordering -- Defined in ‘GHC.Show’ + ...plus 23 others + (use -fprint-potential-instances to see them all) + In the expression: print [1] + In an equation for ‘main’: main = print [1] + +overloadedlistsfail01.hs:5:14: error: + No instance for (IsList a0) arising from an overloaded list + The type variable ‘a0’ is ambiguous + Potential instances: + instance IsList Version -- Defined in ‘GHC.Exts’ + instance IsList [a] -- Defined in ‘GHC.Exts’ + In the first argument of ‘print’, namely ‘[1]’ + In the expression: print [1] + In an equation for ‘main’: main = print [1] + +overloadedlistsfail01.hs:5:15: error: + No instance for (Num (Item a0)) arising from the literal ‘1’ + The type variable ‘a0’ is ambiguous + Potential instances: + instance Num Integer -- Defined in ‘GHC.Num’ + instance Num Double -- Defined in ‘GHC.Float’ + instance Num Float -- Defined in ‘GHC.Float’ + ...plus two others + (use -fprint-potential-instances to see them all) + In the expression: 1 + In the first argument of ‘print’, namely ‘[1]’ + In the expression: print [1] |