summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krz.gogolewski@gmail.com>2018-07-22 18:58:33 +0200
committerBen Gamari <ben@smart-cactus.org>2018-07-31 15:53:19 -0400
commit4c044ed12d1d2e92580b587ae3a5ad001c1e6173 (patch)
tree724b1737b9b6f9fa742339556cd7fd9873e2bd22 /testsuite
parent39ab54c969fa5ca58392f039aa8f790932b9257a (diff)
downloadhaskell-4c044ed12d1d2e92580b587ae3a5ad001c1e6173.tar.gz
Fix pretty-printing of data declarations in splices
Test Plan: validate Reviewers: RyanGlScott, bgamari Reviewed By: RyanGlScott Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15365 Differential Revision: https://phabricator.haskell.org/D4998 (cherry picked from commit 3aa09cc5af9cacba91915c095f9652ee5ed31ec7)
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/th/T15365.hs31
-rw-r--r--testsuite/tests/th/T15365.stderr33
-rw-r--r--testsuite/tests/th/all.T1
3 files changed, 65 insertions, 0 deletions
diff --git a/testsuite/tests/th/T15365.hs b/testsuite/tests/th/T15365.hs
new file mode 100644
index 0000000000..00ff2e644d
--- /dev/null
+++ b/testsuite/tests/th/T15365.hs
@@ -0,0 +1,31 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE PatternSynonyms #-}
+{-# LANGUAGE RoleAnnotations #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE TypeOperators #-}
+module T15365 where
+
+$([d| type (|||) = Either
+
+ (&&&) :: Bool -> Bool -> Bool
+ (&&&) = (&&)
+
+ type role (***)
+ data (***)
+
+ class (???)
+ instance (???)
+
+ data family ($$$)
+ data instance ($$$)
+
+ type family (^^^)
+ type instance (^^^) = Int
+
+ type family (###) where
+ (###) = Int
+
+ pattern (:!!!) :: Bool
+ pattern (:!!!) = True
+ |])
diff --git a/testsuite/tests/th/T15365.stderr b/testsuite/tests/th/T15365.stderr
new file mode 100644
index 0000000000..3c85950831
--- /dev/null
+++ b/testsuite/tests/th/T15365.stderr
@@ -0,0 +1,33 @@
+T15365.hs:(9,3)-(31,6): Splicing declarations
+ [d| (&&&) :: Bool -> Bool -> Bool
+ (&&&) = (&&)
+ pattern (:!!!) :: Bool
+ pattern (:!!!) = True
+
+ type (|||) = Either
+ data (***)
+ class (???)
+ data family ($$$)
+ type family (^^^)
+ type family (###) where
+ (###) = Int
+
+ instance (???)
+ data instance ($$$)
+ type instance (^^^) = Int |]
+ ======>
+ type (|||) = Either
+ (&&&) :: Bool -> Bool -> Bool
+ (&&&) = (&&)
+ type role (***)
+ data (***)
+ class (???)
+ instance (???)
+ data family ($$$)
+ data instance ($$$)
+ type family (^^^)
+ type instance (^^^) = Int
+ type family (###) where
+ (###) = Int
+ pattern (:!!!) :: Bool
+ pattern (:!!!) = True
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index b3d53acd38..f6656c4922 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -418,3 +418,4 @@ 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, [''])
+test('T15365', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])