summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2016-08-29 09:47:56 -0400
committerRyan Scott <ryan.gl.scott@gmail.com>2016-08-29 09:47:56 -0400
commit983f6609b68bf4cef0a5c94cd5568673cab3a6cf (patch)
treed9a2ed5c025e59c176a1e6bd15c9ab5d9e54aba6 /testsuite
parentca8c0e279a87d93c1fb10460c24ef35a9080238f (diff)
downloadhaskell-983f6609b68bf4cef0a5c94cd5568673cab3a6cf.tar.gz
Template Haskell support for TypeApplications
Summary: Fixes #12530. Test Plan: make test TEST=12530 Reviewers: austin, bgamari, hvr, goldfire Reviewed By: goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2472 GHC Trac Issues: #12530
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/th/T12530.hs15
-rw-r--r--testsuite/tests/th/T12530.stderr10
-rw-r--r--testsuite/tests/th/all.T1
3 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/th/T12530.hs b/testsuite/tests/th/T12530.hs
new file mode 100644
index 0000000000..4c0e27dcbf
--- /dev/null
+++ b/testsuite/tests/th/T12530.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeApplications #-}
+module T12530 where
+
+import Language.Haskell.TH
+
+$([d| -- Test the Template Haskell pretty-printing for TypeApplications
+ f :: Maybe Int -> Maybe Int
+ f = id @(Maybe Int)
+
+ -- Wildcards and scoped type variables too
+ g :: forall a. a
+ g = undefined @(_) @(a)
+ |])
diff --git a/testsuite/tests/th/T12530.stderr b/testsuite/tests/th/T12530.stderr
new file mode 100644
index 0000000000..0ba15360ac
--- /dev/null
+++ b/testsuite/tests/th/T12530.stderr
@@ -0,0 +1,10 @@
+T12530.hs:(8,3)-(15,6): Splicing declarations
+ [d| f :: Maybe Int -> Maybe Int
+ f = id @(Maybe Int)
+ g :: forall a. a
+ g = undefined @(_) @(a) |]
+ ======>
+ f :: Maybe Int -> Maybe Int
+ f = id @(Maybe Int)
+ g :: forall a. a
+ g = undefined @_ @a
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index 592e133e7d..2cfe2a509b 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -427,3 +427,4 @@ test('T12478_2', omit_ways(['ghci']), compile_and_run, ['-v0'])
test('T12478_3', omit_ways(['ghci']), compile, ['-v0'])
test('T12478_4', omit_ways(['ghci']), compile_fail, ['-v0'])
test('T12513', omit_ways(['ghci']), compile_fail, ['-v0'])
+test('T12530', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])