diff options
author | David Kraeutmann <kane@kane.cx> | 2015-10-07 20:28:46 -0500 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2015-10-07 20:30:20 -0500 |
commit | 7b443bb1df8f7f0a6b3124537590aa655a9300cd (patch) | |
tree | 9a15aeb8de755743b236f83129ad63fa4ec93304 /testsuite/tests/annotations | |
parent | ea4df12f7f3fc4d1d2af335804b8ec893f45550c (diff) | |
download | haskell-7b443bb1df8f7f0a6b3124537590aa655a9300cd.tar.gz |
Improve error messages for ambiguous type variables
Improved error messages are only printed when the old message would be
"No instance for...", since they're not as helpful for "Could not deduce..."
No special test case as error messages are tested by other tests already.
Signed-off-by: David Kraeutmann <kane@kane.cx>
Reviewed By: austin, goldfire
Differential Revision: https://phabricator.haskell.org/D1182
GHC Trac Issues: #10733
Diffstat (limited to 'testsuite/tests/annotations')
-rw-r--r-- | testsuite/tests/annotations/should_fail/annfail10.stderr | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/testsuite/tests/annotations/should_fail/annfail10.stderr b/testsuite/tests/annotations/should_fail/annfail10.stderr index a8236709c2..1e77541499 100644 --- a/testsuite/tests/annotations/should_fail/annfail10.stderr +++ b/testsuite/tests/annotations/should_fail/annfail10.stderr @@ -1,8 +1,9 @@ annfail10.hs:9:1: error: - No instance for (Data a0) arising from an annotation - The type variable ‘a0’ is ambiguous - Potential instances: + Ambiguous type variable ‘a0’ arising from an annotation + prevents the constraint ‘(Data a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: instance (Data a, Data b) => Data (Either a b) -- Defined in ‘Data.Data’ instance Data All -- Defined in ‘Data.Data’ @@ -13,9 +14,10 @@ annfail10.hs:9:1: error: 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: + Ambiguous type variable ‘a0’ arising from the literal ‘1’ + prevents the constraint ‘(Num a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: instance forall (k :: BOX) (f :: k -> *) (a :: k). Num (f a) => Num (Alt f a) |