diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2019-01-05 12:40:39 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-01-06 07:27:09 -0500 |
commit | bbd58fb5f029b632e2d8977518723feee0737ba7 (patch) | |
tree | 27abc77f6dd9a9ecf2f6423cf2d75c26998bbf69 /testsuite/tests/th | |
parent | 3fb726d0696f4c59e58331e505e49f02f135a2f1 (diff) | |
download | haskell-bbd58fb5f029b632e2d8977518723feee0737ba7.tar.gz |
Fix #16133 by checking for TypeApplications in rnExpr
Diffstat (limited to 'testsuite/tests/th')
-rw-r--r-- | testsuite/tests/th/T16133.hs | 13 | ||||
-rw-r--r-- | testsuite/tests/th/T16133.stderr | 8 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 1 |
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, ['']) |