Commit 9c0646e6 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Add test for Trac #3899

parent b8cad059
{-# LANGUAGE TemplateHaskell #-}
module T3899 where
import T3899a
f = $(nestedTuple 3)
T3899.hs:6:7-19: Splicing expression
nestedTuple 3 ======> \ (Cons x (Cons x (Cons x Nil))) -> (x, x, x)
In the expression: $(nestedTuple 3)
In the definition of `f': f = $(nestedTuple 3)
{-# LANGUAGE TemplateHaskell #-}
module T3899a where
import Language.Haskell.TH
import Control.Monad
data Cons a b = Cons a b
data Nil = Nil
nestedTuple n = do
xs <- replicateM n (newName "x")
return $ LamE [foldr (\v prev -> ConP 'Cons [VarP v,prev]) (ConP 'Nil []) xs]
(TupE $ map VarE xs)
......@@ -159,3 +159,5 @@ test('T3100', normal, compile, ['-v0'])
test('T3600', extra_clean(['T3600a.hi','T3600a.o']),
multimod_compile, ['T3600','-v0'])
test('T3845', normal, compile, ['-v0'])
test('T3899', extra_clean(['T3899a.hi','T3899a.o']),
multimod_compile, ['T3899','-v0 -ddump-splices -dsuppress-uniques'])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment