[commit: testsuite] master: Add a test for #1849 (f062d93)

Ian Lynagh igloo at earth.li
Sat Feb 2 17:33:15 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/f062d930392a56ad2482b4472d0e64787f6c073b

>---------------------------------------------------------------

commit f062d930392a56ad2482b4472d0e64787f6c073b
Author: Ian Lynagh <ian at well-typed.com>
Date:   Sat Feb 2 16:34:53 2013 +0000

    Add a test for #1849

>---------------------------------------------------------------

 tests/th/T1849.script |   10 ++++++++++
 tests/th/T1849.stdout |    6 ++++++
 tests/th/all.T        |    1 +
 3 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/tests/th/T1849.script b/tests/th/T1849.script
new file mode 100644
index 0000000..861b8d4
--- /dev/null
+++ b/tests/th/T1849.script
@@ -0,0 +1,10 @@
+:set -XTemplateHaskell
+import Language.Haskell.TH
+let seeType n = do VarI _ t _ _ <- reify n; runIO $ putStrLn $ show t; [| return True |]
+let f = undefined :: Int -> Int
+let g = undefined :: [Int]
+let h = undefined :: (Int, Int)
+$(seeType (mkName "f"))
+$(seeType (mkName "g"))
+$(seeType (mkName "h"))
+
diff --git a/tests/th/T1849.stdout b/tests/th/T1849.stdout
new file mode 100644
index 0000000..3d48e77
--- /dev/null
+++ b/tests/th/T1849.stdout
@@ -0,0 +1,6 @@
+AppT (AppT ArrowT (ConT GHC.Types.Int)) (ConT GHC.Types.Int)
+True
+AppT ListT (ConT GHC.Types.Int)
+True
+AppT (AppT (TupleT 2) (ConT GHC.Types.Int)) (ConT GHC.Types.Int)
+True
diff --git a/tests/th/all.T b/tests/th/all.T
index 9eedda7..2d190dd 100644
--- a/tests/th/all.T
+++ b/tests/th/all.T
@@ -268,3 +268,4 @@ test('T7532',
      multimod_compile,
      ['T7532', '-v0'])
 test('T2222', normal, compile, ['-v0'])
+test('T1849', normal, ghci_script, ['T1849.script'])





More information about the ghc-commits mailing list