Fix Trac #3423: missed instantiation for newtype-derived instances
authorsimonpj@microsoft.com <unknown>
Fri, 21 Aug 2009 21:07:00 +0000 (21:07 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 21 Aug 2009 21:07:00 +0000 (21:07 +0000)
commitb70fc87dfe3b38b4cbc76285bccbce16d3ac6914
tree74dba9c3a11e476b1cf61026c5a15d90153ede94
parentb0ec2cb2ab74b21ea1f790c062cd213aa9d9ef02
Fix Trac #3423: missed instantiation for newtype-derived instances

Somehow I'd forgotten to instantiate the coercion that is stored in a
'NewtypeDerived' constructor in an InstInfo.  The necessary code is
in TcInstDcls.tc_inst_decl2.

The result was ghc: panic! (the 'impossible' happened)
   (GHC version 6.10.3 for x86_64-unknown-linux):
   No match in record selector Var.tcTyVarDetails
because we were looking at an (uninstantiated) TyVar instead of
an (instantiated) TcTyVar.
compiler/typecheck/TcDeriv.lhs
compiler/typecheck/TcInstDcls.lhs