diff options
author | Geoffrey Mainland <mainland@apeiron.net> | 2013-05-16 15:03:05 +0100 |
---|---|---|
committer | Geoffrey Mainland <mainland@apeiron.net> | 2013-10-04 14:58:40 -0400 |
commit | 4ccdc324530d51caad2098774e741b6c8c4dd74f (patch) | |
tree | 2694975937f32c5e048304eb0ce5a430e65e9d11 /testsuite/tests/th/T2222.hs | |
parent | c5806bf6928daebb89b126efffdc2e2a00927250 (diff) | |
download | haskell-4ccdc324530d51caad2098774e741b6c8c4dd74f.tar.gz |
Adjust tests for new Template Haskell.
From the new Template Haskell proposal at
http://hackage.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal
A declaration group is the chunk of declarations created by a top-level
declaration splice, plus those following it, down to but not including the
next top-level declaration splice. Then the type environment seen by reify
includes all the declaration up to the end of the immediately preceding
declaration block, but no more.
This change adds '$(return [])' where necessary to allow following declarations
to see (module-local) top-level definitions.
Diffstat (limited to 'testsuite/tests/th/T2222.hs')
-rw-r--r-- | testsuite/tests/th/T2222.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/testsuite/tests/th/T2222.hs b/testsuite/tests/th/T2222.hs index 9a97c0d4d3..bba923183a 100644 --- a/testsuite/tests/th/T2222.hs +++ b/testsuite/tests/th/T2222.hs @@ -7,12 +7,16 @@ import System.IO a = 1 +$(return []) + b = $(do VarI _ t _ _ <- reify 'a runIO $ putStrLn ("inside b: " ++ pprint t) [| undefined |]) c = $([| True |]) +$(return []) + d = $(do VarI _ t _ _ <- reify 'c runIO $ putStrLn ("inside d: " ++ pprint t) [| undefined |] ) @@ -23,6 +27,8 @@ $(do VarI _ t _ _ <- reify 'c e = $([| True |]) +$(return []) + f = $(do VarI _ t _ _ <- reify 'e runIO $ putStrLn ("inside f: " ++ pprint t) [| undefined |] ) |