diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2014-09-26 10:53:32 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2014-09-26 12:34:51 +0100 |
commit | 1a88f9a4fb373ce52284996212fc23b06848b1c0 (patch) | |
tree | f47edfba08918411312ea1825d5392d3cde43caf /testsuite/tests/typecheck/should_fail/T9612.stderr | |
parent | 8c9d0ce490506fdc60d9f25d4b80774180cf92ce (diff) | |
download | haskell-1a88f9a4fb373ce52284996212fc23b06848b1c0.tar.gz |
Improve error messages from functional dependencies
Reponding to Trac #9612:
* Track the CtOrigin of a Derived equality, arising from a
functional dependency
* And report it clearly in the error stream
This relies on a previous commit, in which I stop dropping Derived
insolubles on the floor.
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T9612.stderr')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T9612.stderr | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T9612.stderr b/testsuite/tests/typecheck/should_fail/T9612.stderr new file mode 100644 index 0000000000..823fee112c --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T9612.stderr @@ -0,0 +1,20 @@ + +T9612.hs:16:9: + Couldn't match type ‘[(Int, a)]’ with ‘(Int, a)’ + arising from a functional dependency between: + constraint ‘MonadWriter (Int, a) (WriterT [(Int, a)] Identity)’ + arising from a use of ‘tell’ + instance ‘MonadWriter w (WriterT w m)’ at T9612.hs:20:10-59 + Relevant bindings include + x :: a (bound at T9612.hs:14:8) + y :: a (bound at T9612.hs:14:3) + f :: a -> (Int, a) -> Writer [(Int, a)] (Int, a) + (bound at T9612.hs:14:1) + In a stmt of a 'do' block: tell (n, x) + In the expression: + do { tell (n, x); + return (1, y) } + In an equation for ‘f’: + f y (n, x) + = do { tell (n, x); + return (1, y) } |