diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2018-07-04 16:43:13 +0300 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-07-12 17:06:11 -0400 |
commit | 1fca115b77de11358140faba1fd028b898f3db2e (patch) | |
tree | c7beb71302a7feb45a66a940ad146abaf5309c91 /testsuite | |
parent | 22c951e6aab52adf32499a9568be44dc60e72acb (diff) | |
download | haskell-1fca115b77de11358140faba1fd028b898f3db2e.tar.gz |
Add regression test for #15321
(cherry picked from commit e835fdb18cca66820728afce9c924a1c71f17fee)
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/th/T15321.hs | 9 | ||||
-rw-r--r-- | testsuite/tests/th/T15321.stderr | 12 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/th/T15321.hs b/testsuite/tests/th/T15321.hs new file mode 100644 index 0000000000..0f0b4d5183 --- /dev/null +++ b/testsuite/tests/th/T15321.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T15321 where + +foo :: String +foo = test + +bar :: String +bar = $(_ "baz") diff --git a/testsuite/tests/th/T15321.stderr b/testsuite/tests/th/T15321.stderr new file mode 100644 index 0000000000..7807bcf5a2 --- /dev/null +++ b/testsuite/tests/th/T15321.stderr @@ -0,0 +1,12 @@ + +T15321.hs:9:9: error: + • Found hole: _ :: [Char] -> Language.Haskell.TH.Lib.Internal.ExpQ + • In the expression: _ + In the expression: _ "baz" + In the untyped splice: $(_ "baz") + • Valid hole fits include + fail :: forall (m :: * -> *) a. Monad m => String -> m a + with fail @Language.Haskell.TH.Syntax.Q + @Language.Haskell.TH.Syntax.Exp + (imported from ‘Prelude’ at T15321.hs:3:8-13 + (and originally defined in ‘GHC.Base’)) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 5f756fcd79..b3d53acd38 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -417,3 +417,4 @@ test('T14885c', normal, compile, ['']) test('T15243', normal, compile, ['-dsuppress-uniques']) test('T15331', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15324', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T15321', normal, compile_fail, ['']) |