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/annotations | |
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/annotations')
-rw-r--r-- | testsuite/tests/annotations/should_fail/annfail10.stderr | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/testsuite/tests/annotations/should_fail/annfail10.stderr b/testsuite/tests/annotations/should_fail/annfail10.stderr index 5ac8ab50b3..a8236709c2 100644 --- a/testsuite/tests/annotations/should_fail/annfail10.stderr +++ b/testsuite/tests/annotations/should_fail/annfail10.stderr @@ -1,25 +1,27 @@ -
-annfail10.hs:9:1:
- No instance for (Data a0) arising from an annotation
- The type variable ‘a0’ is ambiguous
- Note: there are several potential instances:
- instance (Data a, Data b) => Data (Either a b)
- -- Defined in ‘Data.Data’
- instance Data All -- Defined in ‘Data.Data’
- instance (Data (f a), Data a, Typeable f) => Data (Alt f a)
- -- Defined in ‘Data.Data’
- ...plus 39 others
- In the annotation: {-# ANN f 1 #-}
-
-annfail10.hs:9:11:
- No instance for (Num a0) arising from the literal ‘1’
- The type variable ‘a0’ is ambiguous
- Note: there are several potential instances:
- instance forall (k :: BOX) (f :: k -> *) (a :: k).
- Num (f a) =>
- Num (Alt f a)
- -- Defined in ‘Data.Monoid’
- instance Num a => Num (Product a) -- Defined in ‘Data.Monoid’
- instance Num a => Num (Sum a) -- Defined in ‘Data.Monoid’
- ...plus 14 others
- In the annotation: {-# ANN f 1 #-}
+ +annfail10.hs:9:1: error: + No instance for (Data a0) arising from an annotation + The type variable ‘a0’ is ambiguous + Potential instances: + instance (Data a, Data b) => Data (Either a b) + -- Defined in ‘Data.Data’ + instance Data All -- Defined in ‘Data.Data’ + instance (Data (f a), Data a, Typeable f) => Data (Alt f a) + -- Defined in ‘Data.Data’ + ...plus 39 others + (use -fprint-potential-instances to see them all) + In the annotation: {-# ANN f 1 #-} + +annfail10.hs:9:11: error: + No instance for (Num a0) arising from the literal ‘1’ + The type variable ‘a0’ is ambiguous + Potential instances: + instance forall (k :: BOX) (f :: k -> *) (a :: k). + Num (f a) => + Num (Alt f a) + -- Defined in ‘Data.Monoid’ + instance Num a => Num (Product a) -- Defined in ‘Data.Monoid’ + instance Num a => Num (Sum a) -- Defined in ‘Data.Monoid’ + ...plus 14 others + (use -fprint-potential-instances to see them all) + In the annotation: {-# ANN f 1 #-} |