[project @ 2005-03-09 14:26:56 by simonpj]
authorsimonpj <unknown>
Wed, 9 Mar 2005 14:27:03 +0000 (14:27 +0000)
committersimonpj <unknown>
Wed, 9 Mar 2005 14:27:03 +0000 (14:27 +0000)
commitaca101dd54968a1da6decc86716f5d0fdb2fd989
tree99b8ecd65d9406bca0adee9f666956259ab885b8
parent0d197643ea29ae54ed91e51fc890893b2ae5e16c
[project @ 2005-03-09 14:26:56 by simonpj]
Fix the superclass translation for instance decls
Merge to STABLE

There is a long-standing difficulty whereby it's surprisingly easy
to accidentally generate an entirely-bogus recursive dictionary when
generating the definitions for the superclasses of an instance decl.

The problem arises because the default story is that whenever we
add a constraint to our pile of solved constraints, we automatically
add all its superclasses.  But that is simply wrong when we are trying
to generate superclasses.

Solution: do no auto-superclass addition when solving the superclass
constraints of an instance declaration.  I think should fix it once and
for all.

tcrun021, tcrun033 are test cases

tcrun033 showed up the bug; thanks to Simon Foster and Ralf Laemmel.
ghc/compiler/typecheck/Inst.lhs
ghc/compiler/typecheck/TcInstDcls.lhs
ghc/compiler/typecheck/TcSimplify.lhs