diff options
author | Richard Eisenberg <eir@cis.upenn.edu> | 2014-10-21 09:12:34 -0400 |
---|---|---|
committer | Richard Eisenberg <eir@cis.upenn.edu> | 2014-11-01 21:12:53 -0400 |
commit | f688f0377e13e0762d422ed3a83e74b5d39b5e13 (patch) | |
tree | 29d10b50ef3b675fcf3a7a847fd86416a571af16 /testsuite/tests | |
parent | a47ff8be5aa78aff2eb80d5f91e294f52ea392e0 (diff) | |
download | haskell-f688f0377e13e0762d422ed3a83e74b5d39b5e13.tar.gz |
Test #9262 in th/T9262, and update other tests.
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/th/T6114.hs | 13 | ||||
-rw-r--r-- | testsuite/tests/th/T6114.stderr | 12 | ||||
-rw-r--r-- | testsuite/tests/th/T9262.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/th/T9262.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 3 |
5 files changed, 21 insertions, 20 deletions
diff --git a/testsuite/tests/th/T6114.hs b/testsuite/tests/th/T6114.hs index bea852c2b6..c5278e3175 100644 --- a/testsuite/tests/th/T6114.hs +++ b/testsuite/tests/th/T6114.hs @@ -1,11 +1,10 @@ {-# 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] - undefined - ) +$(do + xName <- newName "x" + instanceType <- [t| $(varT xName) |] + _ <- reifyInstances ''Eq [instanceType] + return [] + ) diff --git a/testsuite/tests/th/T6114.stderr b/testsuite/tests/th/T6114.stderr deleted file mode 100644 index 917b56f768..0000000000 --- a/testsuite/tests/th/T6114.stderr +++ /dev/null @@ -1,12 +0,0 @@ - -T6114.hs:6:17: - 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]; - .... }) diff --git a/testsuite/tests/th/T9262.hs b/testsuite/tests/th/T9262.hs new file mode 100644 index 0000000000..8a44603dff --- /dev/null +++ b/testsuite/tests/th/T9262.hs @@ -0,0 +1,12 @@ +{-# 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 [] ) diff --git a/testsuite/tests/th/T9262.stderr b/testsuite/tests/th/T9262.stderr new file mode 100644 index 0000000000..efdf5e3e09 --- /dev/null +++ b/testsuite/tests/th/T9262.stderr @@ -0,0 +1 @@ +instance GHC.Classes.Eq a_0 => GHC.Classes.Eq ([a_0]) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 2981202300..d3ae4e4430 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -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, ['']) test('T7064', 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']) |