summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T4921.stderr
diff options
context:
space:
mode:
authorDavid Kraeutmann <kane@kane.cx>2015-10-07 20:28:46 -0500
committerAustin Seipp <austin@well-typed.com>2015-10-07 20:30:20 -0500
commit7b443bb1df8f7f0a6b3124537590aa655a9300cd (patch)
tree9a15aeb8de755743b236f83129ad63fa4ec93304 /testsuite/tests/typecheck/should_fail/T4921.stderr
parentea4df12f7f3fc4d1d2af335804b8ec893f45550c (diff)
downloadhaskell-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/typecheck/should_fail/T4921.stderr')
-rw-r--r--testsuite/tests/typecheck/should_fail/T4921.stderr14
1 files changed, 8 insertions, 6 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T4921.stderr b/testsuite/tests/typecheck/should_fail/T4921.stderr
index 091d461328..42d5a8a363 100644
--- a/testsuite/tests/typecheck/should_fail/T4921.stderr
+++ b/testsuite/tests/typecheck/should_fail/T4921.stderr
@@ -1,18 +1,20 @@
T4921.hs:10:9: error:
- No instance for (C a0 b1) arising from a use of ‘f’
- The type variables ‘b1’, ‘a0’ are ambiguous
+ Ambiguous type variables ‘b1’, ‘a0’ arising from a use of ‘f’
+ prevents the constraint ‘(C a0 b1)’ from being solved.
Relevant bindings include x :: a0 (bound at T4921.hs:10:1)
- Potential instances:
+ Probable fix: use a type annotation to specify what ‘b1’, ‘a0’ should be.
+ These potential instance exist:
instance C Int Char -- Defined at T4921.hs:7:10
In the first argument of ‘fst’, namely ‘f’
In the expression: fst f
In an equation for ‘x’: x = fst f
T4921.hs:12:9: error:
- No instance for (C Int b0) arising from a use of ‘f’
- The type variable ‘b0’ is ambiguous
- Potential instances:
+ Ambiguous type variable ‘b0’ arising from a use of ‘f’
+ prevents the constraint ‘(C Int b0)’ from being solved.
+ Probable fix: use a type annotation to specify what ‘b0’ should be.
+ These potential instance exist:
instance C Int Char -- Defined at T4921.hs:7:10
In the first argument of ‘fst’, namely ‘f’
In the expression: fst f :: Int