summaryrefslogtreecommitdiff
path: root/testsuite/tests/th
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2019-01-05 12:40:39 -0500
committerBen Gamari <ben@smart-cactus.org>2019-01-06 07:27:09 -0500
commitbbd58fb5f029b632e2d8977518723feee0737ba7 (patch)
tree27abc77f6dd9a9ecf2f6423cf2d75c26998bbf69 /testsuite/tests/th
parent3fb726d0696f4c59e58331e505e49f02f135a2f1 (diff)
downloadhaskell-bbd58fb5f029b632e2d8977518723feee0737ba7.tar.gz
Fix #16133 by checking for TypeApplications in rnExpr
Diffstat (limited to 'testsuite/tests/th')
-rw-r--r--testsuite/tests/th/T16133.hs13
-rw-r--r--testsuite/tests/th/T16133.stderr8
-rw-r--r--testsuite/tests/th/all.T1
3 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/th/T16133.hs b/testsuite/tests/th/T16133.hs
new file mode 100644
index 0000000000..b7f5e23d09
--- /dev/null
+++ b/testsuite/tests/th/T16133.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE TemplateHaskell #-}
+module T16133 where
+
+import Data.Kind
+import Language.Haskell.TH hiding (Type)
+
+data P (a :: k) = MkP
+
+$([d| f :: Int
+ f = $(varE 'id `appTypeE` conT ''Int `appE` litE (integerL 42))
+
+ type P' = $(conT ''P `appKindT` conT ''Type) |])
diff --git a/testsuite/tests/th/T16133.stderr b/testsuite/tests/th/T16133.stderr
new file mode 100644
index 0000000000..30dcd3ada0
--- /dev/null
+++ b/testsuite/tests/th/T16133.stderr
@@ -0,0 +1,8 @@
+
+T16133.hs:10:3: error:
+ Illegal visible kind application ‘@Type’
+ Perhaps you intended to use TypeApplications
+
+T16133.hs:10:3: error:
+ Illegal visible type application ‘@Int’
+ Perhaps you intended to use TypeApplications
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index 7f420fb6e7..48b768127e 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -465,3 +465,4 @@ test('T15845', normal, compile, ['-v0 -dsuppress-uniques'])
test('T15437', expect_broken(15437), multimod_compile,
['T15437', '-v0 ' + config.ghc_th_way_flags])
test('T15985', normal, compile, [''])
+test('T16133', normal, compile_fail, [''])