#7532: -ddump-splices output doesn't match generated code for data instances
inside instances.
-----------------------------+----------------------------------------------
Reporter:  Aninhumer         |          Owner:                  
    Type:  bug               |         Status:  new             
Priority:  normal            |      Component:  Template Haskell
 Version:  7.6.1             |       Keywords:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
 Failure:  None/Unknown      |      Blockedby:                  
Blocking:                    |        Related:                  
-----------------------------+----------------------------------------------
 Using the following code:
 {{{
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeFamilies #-}

 module Test where

 import Language.Haskell.TH

 class C a where
     data D a

 bang :: DecsQ
 bang = return [
     InstanceD [] (AppT (ConT ''C) (ConT ''Int)) [
         DataInstD [] ''D [ConT ''Int] [
             NormalC (mkName "T") []] []]]
 }}}

 {{{
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeFamilies #-}

 import Language.Haskell.TH
 import Test

 $(bang)
 }}}
 When compiling the second file in GHCi with -ddump-splices set, the output
 is:
 {{{
 th-test2.hs:1:1: Splicing declarations
     bang
   ======>
     th-test2.hs:9:3-6
     instance C Int where
       data instance D Int = T
 Ok, modules loaded: Test, Main.
 }}}
 This compiles successfully, but the dumped splice is clearly incorrect
 (which I confirmed by attempting to splice this code manually into the
 same place).

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to