Fix Trac #2456: eliminate duplicate bindings when deriving
authorsimonpj@microsoft.com <unknown>
Wed, 20 Aug 2008 12:07:51 +0000 (12:07 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 20 Aug 2008 12:07:51 +0000 (12:07 +0000)
commitec29e12f0df59d01a7f82adee9f8cd2ab8c37b00
tree9440b0fca4f86a70cdb0b3c1b55131ef8e2654e3
parent5e09d0886105fdfec4d7e8aaf2115b92ee18cfaa
Fix Trac #2456: eliminate duplicate bindings when deriving

Condsider deriving two overlapping Data declarations for the same type
deriving instance Data (T A)
deriving instance Data (T B)

We were getting duplicate bindings for the data-con and tycon auxiliary
bindings for T.  This patch fixes the problem by doing these two decls
the same way as we do con2tag etc.

(Why might you want such instances; see Trac #2456.)
compiler/typecheck/TcGenDeriv.lhs