#5410: Template Haskell - splicing quoted instance decls mangles names
---------------------------------+------------------------------------------
    Reporter:  mokus             |       Owner:                             
        Type:  bug               |      Status:  new                        
    Priority:  normal            |   Component:  Template Haskell           
     Version:                    |    Keywords:                             
    Testcase:                    |   Blockedby:                             
          Os:  Unknown/Multiple  |    Blocking:                             
Architecture:  Unknown/Multiple  |     Failure:  Incorrect result at runtime
---------------------------------+------------------------------------------
 When updating a library of mine (random-fu) to build on GHC 7.2.1, I found
 that TH-generated instance declarations were universally broken; they did
 not have any class functions implemented, where in earlier versions of GHC
 there has never been a problem.  I was able to reduce it to a very trivial
 case which shows that quoting and splicing is not a no-op as it seems it
 should be.

 The entire failing case consists of:

 {{{
 {-# LANGUAGE TemplateHaskell #-}
 module GHC_7_2_1_bug where

 $([d| instance Show (a -> b) where
         showsPrec _ _ = showString "<function>"
  |])

 }}}

 which generates the following splice:

 {{{
     instance Show (a_a1uB -> b_a1uC) where
         { showsPrec_a1uD _ _ = showString "<function>" }
 }}}

 As would be expected from looking at the splice, there is no showsPrec
 definition, and typing "id" at the GHCi prompt gives an infinite loop from
 the cyclic defaults.

 BTW, there is no "version" entry in the ticket reporting interface for
 7.2.1, so I've left that unspecified.

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