#5884: GHC panics while trying to derive a Generic instance for Complex a
---------------------------------+------------------------------------------
  Reporter:  mux                 |          Owner:  dreixel         
      Type:  bug                 |         Status:  closed          
  Priority:  normal              |      Milestone:                  
 Component:  Compiler            |        Version:  7.4.1           
Resolution:  fixed               |       Keywords:                  
        Os:  Unknown/Multiple    |   Architecture:  Unknown/Multiple
   Failure:  Compile-time crash  |     Difficulty:  Unknown         
  Testcase:                      |      Blockedby:                  
  Blocking:                      |        Related:                  
---------------------------------+------------------------------------------
Changes (by simonpj):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Fixed by
 {{{
 commit 9e3171c632d200ae1b259dd3501fa6f6d9ac3278
 Author: Simon Peyton Jones <[email protected]>
 Date:   Thu Apr 26 14:39:59 2012 +0100

     Make the RHS of a generic FamInst use the same type variables as the
 LHS!

  compiler/typecheck/TcGenGenerics.lhs |   22 ++++++++++++----------
  1 files changed, 12 insertions(+), 10 deletions(-)
 }}}
 The problem was that in `tc_mkRepTy` you were using `dataConOrigArgTys` to
 get the argument types of the data con.  Now these may or may not be
 identical with the `tyConTyVars` of the parent `TyCon`.  (They used to be
 the same, but it's a fragile assumption, and turns out not to be so here.)

 The solution is simple: use `dataConInstOrigArgTys` to instantiate the
 data constructor's type. That means passing a list of arg types to
 `tc_mkRepTy`, which in turn may get us on the way to #5936.

 Anyway this one works now.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5884#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to