Improve error messages from functional dependencies
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 26 Sep 2014 09:53:32 +0000 (10:53 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 26 Sep 2014 11:34:51 +0000 (12:34 +0100)
commit1a88f9a4fb373ce52284996212fc23b06848b1c0
treef47edfba08918411312ea1825d5392d3cde43caf
parent8c9d0ce490506fdc60d9f25d4b80774180cf92ce
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.
13 files changed:
compiler/typecheck/FunDeps.lhs
compiler/typecheck/TcErrors.lhs
compiler/typecheck/TcInteract.lhs
compiler/typecheck/TcRnTypes.lhs
compiler/typecheck/TcUnify.lhs
testsuite/tests/typecheck/should_compile/FD3.stderr
testsuite/tests/typecheck/should_fail/FDsFromGivens.stderr
testsuite/tests/typecheck/should_fail/T5236.stderr
testsuite/tests/typecheck/should_fail/T5978.stderr
testsuite/tests/typecheck/should_fail/T9612.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T9612.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T
testsuite/tests/typecheck/should_fail/tcfail143.stderr