Commit f688f037 authored by's avatar

Test #9262 in th/T9262, and update other tests.

parent a47ff8be
{-# LANGUAGE TemplateHaskell #-}
module T6114 where
import Language.Haskell.TH
import Control.Monad.Instances ()
instanceVar = $(do
xName <- newName "x"
instanceType <- [t| $(varT xName) |]
_ <- reifyInstances ''Eq [instanceType]
xName <- newName "x"
instanceType <- [t| $(varT xName) |]
_ <- reifyInstances ''Eq [instanceType]
return []
The exact Name ‘x’ is not in scope
Probable cause: you used a unique Template Haskell name (NameU),
perhaps via newName, but did not bind it
If that's it, then -ddump-splices might be useful
In the argument of reifyInstances: GHC.Classes.Eq x_0
In the splice:
$(do { xName <- newName "x";
instanceType <- [t| $(varT xName) |];
_ <- reifyInstances ''Eq [instanceType];
.... })
{-# LANGUAGE TemplateHaskell #-}
module T9262 where
import Language.Haskell.TH
import Language.Haskell.TH.Ppr
import System.IO
$(do insts <- reifyInstances ''Eq [ListT `AppT` VarT (mkName "a")]
runIO $ putStrLn $ pprint insts
runIO $ hFlush stdout
return [] )
instance GHC.Classes.Eq a_0 => GHC.Classes.Eq ([a_0])
......@@ -251,7 +251,7 @@ test('T5795', normal, compile_fail, ['-v0'])
test('T6005', normal, compile, ['-v0'])
test('T6005a', normal, compile, ['-v0'])
test('T5737', normal, compile, ['-v0'])
test('T6114', normal, compile_fail, ['-v0 -dsuppress-uniques'])
test('T6114', normal, compile, ['-v0'])
test('TH_StringPrimL', normal, compile_and_run, [''])
extra_clean(['T7064a.hi', 'T7064a.o']),
......@@ -329,5 +329,6 @@ test('T8954', normal, compile, ['-v0'])
test('T8932', normal, compile_fail, ['-v0'])
test('T8987', normal, compile_fail, ['-v0'])
test('T7241', normal, compile_fail, ['-v0'])
test('T9262', normal, compile, ['-v0'])
test('T9199', normal, compile, ['-v0'])
test('T9692', 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