Add regression test for #15321
authorÖmer Sinan Ağacan <omeragacan@gmail.com>
Wed, 4 Jul 2018 13:43:13 +0000 (16:43 +0300)
committerBen Gamari <ben@smart-cactus.org>
Thu, 12 Jul 2018 21:06:11 +0000 (17:06 -0400)
(cherry picked from commit e835fdb18cca66820728afce9c924a1c71f17fee)

testsuite/tests/th/T15321.hs [new file with mode: 0644]
testsuite/tests/th/T15321.stderr [new file with mode: 0644]
testsuite/tests/th/all.T

diff --git a/testsuite/tests/th/T15321.hs b/testsuite/tests/th/T15321.hs
new file mode 100644 (file)
index 0000000..0f0b4d5
--- /dev/null
@@ -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 (file)
index 0000000..7807bcf
--- /dev/null
@@ -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’))
index 5f756fc..b3d53ac 100644 (file)
@@ -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, [''])