Commit 518c56d8 authored by ian@well-typed.com's avatar ian@well-typed.com

Add a test for #2222

parent 79a6a7a4
{-# 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 [] )
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
......@@ -267,3 +267,4 @@ test('T7532',
extra_clean(['T7532a.hi', 'T7532a.o']),
multimod_compile,
['T7532', '-v0'])
test('T2222', normal, compile, ['-v0'])
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