diff options
author | simonpj <simonpj@microsoft.com> | 2010-02-10 15:37:41 +0000 |
---|---|---|
committer | simonpj <simonpj@microsoft.com> | 2010-02-10 15:37:41 +0000 |
commit | 4ca21027dea88da96ad3149be3e3fc2ea15e25da (patch) | |
tree | 6f6240cfd24b9012ce4d5d7207e9294cc47daf59 /testsuite/tests | |
parent | 1df10fbdd00e535e161ab888b42e9363afb4fddb (diff) | |
download | haskell-4ca21027dea88da96ad3149be3e3fc2ea15e25da.tar.gz |
Test Trac #3845
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/ghc-regress/th/T3845.hs | 21 | ||||
-rw-r--r-- | testsuite/tests/ghc-regress/th/all.T | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-regress/th/T3845.hs b/testsuite/tests/ghc-regress/th/T3845.hs new file mode 100644 index 0000000000..29dc51fbda --- /dev/null +++ b/testsuite/tests/ghc-regress/th/T3845.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE TemplateHaskell #-} + +module THBug1 where + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax + +data HCons a b = HCons a b +data HNil = HNil + +mhlt :: [Q Type] -> Q Type +mhlt xss = [t| $(foldThing xss)|] + where + foldThing (x:xs) = [t| HCons $x $(foldThing xs)|] + foldThing [] = [t| HNil |] + +mhlt1 :: [Int] -> Q Exp +mhlt1 xss = [| $(foldThing1 xss) |] + where + foldThing1 (x:xs) = [| x : $(foldThing1 xs)|] + foldThing1 [] = [| [] |] diff --git a/testsuite/tests/ghc-regress/th/all.T b/testsuite/tests/ghc-regress/th/all.T index 43b7e077a0..b8948742b4 100644 --- a/testsuite/tests/ghc-regress/th/all.T +++ b/testsuite/tests/ghc-regress/th/all.T @@ -158,3 +158,4 @@ test('T3100', normal, compile, ['-v0']) test('T3600', extra_clean(['T3600a.hi','T3600a.o']), multimod_compile, ['T3600','-v0']) +test('T3845', normal, compile, ['-v0']) |