[commit: ghc] master: Reject bad 'deriving' directives (fixes Trac #5287) (49861e7)
Simon Peyton Jones
simonpj at microsoft.com
Mon Jul 25 10:28:43 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/49861e71e3873bafddbd7b0c21041a8b7902af4b
>---------------------------------------------------------------
commit 49861e71e3873bafddbd7b0c21041a8b7902af4b
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Sat Jul 23 18:30:46 2011 +0100
Reject bad 'deriving' directives (fixes Trac #5287)
The 'deriving' mechanism that infers the context for
an instance declarations was going into a loop, as a
result of an instance like
instance C a b => D [a]
where the 'b' isn't mentioned in the head.
This patch identifies those cases. I also needed to make
TcErrors generate a suitable error message. On the way
I improved the reporting of "ambiguous" variables;
for example arrowfail001 now generates a better message.
compiler/typecheck/TcDeriv.lhs | 22 +--------
compiler/typecheck/TcErrors.lhs | 95 ++++++++++++++++++-------------------
compiler/typecheck/TcMType.lhs | 38 ++++++++++-----
compiler/typecheck/TcSimplify.lhs | 5 +-
compiler/typecheck/TcType.lhs | 20 ++++++--
5 files changed, 91 insertions(+), 89 deletions(-)
Diff suppressed because of size. To see it, use:
git show 49861e71e3873bafddbd7b0c21041a8b7902af4b
More information about the Cvs-ghc
mailing list