[commit: testsuite] master: Add a test for #2222 (96f7182)

Ian Lynagh igloo at earth.li
Fri Feb 1 19:33:35 CET 2013


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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/96f71821f88d190d88798904fdc1fe2150b8eaf9

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

commit 96f71821f88d190d88798904fdc1fe2150b8eaf9
Author: Ian Lynagh <ian at well-typed.com>
Date:   Fri Feb 1 18:15:40 2013 +0000

    Add a test for #2222

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

 tests/th/T2222.hs     |   36 ++++++++++++++++++++++++++++++++++++
 tests/th/T2222.stderr |    5 +++++
 tests/th/all.T        |    1 +
 3 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/tests/th/T2222.hs b/tests/th/T2222.hs
new file mode 100644
index 0000000..9a97c0d
--- /dev/null
+++ b/tests/th/T2222.hs
@@ -0,0 +1,36 @@
+
+{-# LANGUAGE TemplateHaskell #-}
+module ReifyPlusTypeInferenceBugs where
+
+import Language.Haskell.TH
+import System.IO
+
+a = 1
+
+b = $(do VarI _ t _ _ <- reify 'a
+         runIO $ putStrLn ("inside b: " ++ pprint t)
+         [| undefined |]) 
+
+c = $([| True |])
+
+d = $(do VarI _ t _ _ <- reify 'c
+         runIO $ putStrLn ("inside d: " ++ pprint t)
+         [| undefined |] )
+
+$(do VarI _ t _ _ <- reify 'c
+     runIO $ putStrLn ("type of c: " ++ pprint t)
+     return [] )
+
+e = $([| True |])
+
+f = $(do VarI _ t _ _ <- reify 'e
+         runIO $ putStrLn ("inside f: " ++ pprint t)
+         [| undefined |] )
+
+$(do VarI _ t _ _ <- reify 'e
+     runIO $ putStrLn ("type of e: " ++ pprint t)
+     return [] )
+
+$( runIO $ do hFlush stdout
+              hFlush stderr
+              return [] )
diff --git a/tests/th/T2222.stderr b/tests/th/T2222.stderr
new file mode 100644
index 0000000..7d90eb3
--- /dev/null
+++ b/tests/th/T2222.stderr
@@ -0,0 +1,5 @@
+inside d: t_0
+inside b: a_0
+type of c: GHC.Types.Bool
+inside f: GHC.Types.Bool
+type of e: GHC.Types.Bool
diff --git a/tests/th/all.T b/tests/th/all.T
index 21464d2..9eedda7 100644
--- a/tests/th/all.T
+++ b/tests/th/all.T
@@ -267,3 +267,4 @@ test('T7532',
      extra_clean(['T7532a.hi', 'T7532a.o']),
      multimod_compile,
      ['T7532', '-v0'])
+test('T2222', normal, compile, ['-v0'])





More information about the ghc-commits mailing list