#6114: ghc: panic! occurred with use of isInstance, newName and a type splice
---------------------------------+------------------------------------------
  Reporter:  davidmiani          |          Owner:                
      Type:  bug                 |         Status:  closed        
  Priority:  normal              |      Milestone:                
 Component:  Template Haskell    |        Version:  7.4.1         
Resolution:  fixed               |       Keywords:                
        Os:  MacOS X             |   Architecture:  x86_64 (amd64)
   Failure:  Compile-time crash  |     Difficulty:  Unknown       
  Testcase:  th/T6114            |      Blockedby:                
  Blocking:                      |        Related:                
---------------------------------+------------------------------------------
Changes (by simonpj):

  * status:  new => closed
  * difficulty:  => Unknown
  * resolution:  => fixed
  * testcase:  => th/T6114


Comment:

 The error message is this:
 {{{
 T6114.hs:6:17:
     The exact Name `x_a12K' is not in scope
       Probable cause: you used a unique Template Haskell name (NameU),
       perhaps via newName, but did not bind it
       If that's it, then -ddump-splices might be useful
     In the argument of reifyInstances: GHC.Classes.Eq x_0
     In the expression:
       $(do { xName <- newName "x";
              instanceType <- [t| $(varT xName) |];
              _ <- reifyInstances ''Eq [instanceType];
              .... })
     In an equation for `instanceVar':
         instanceVar
           = $(do { xName <- newName "x";
                    instanceType <- [t| $(varT xName) |];
                    .... })
 }}}
 So the crash is fixed, and the error message does point to the culprit.

 The difference between "x_a12K" and "x_0" is unhelpful, but it's not
 particularly easy to fix.  (The "x_0" comes from applying the TH pretty-
 printer, which renames uniques, to the input types; the "x_a12K" is what
 the renamer sees.)

 So I'm going to close this ticket and wait for someone to complain about
 it :-)

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6114#comment:3>
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