summaryrefslogtreecommitdiff
path: root/testsuite/tests/th
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krz.gogolewski@gmail.com>2018-07-22 18:58:33 +0200
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>2018-07-22 18:58:33 +0200
commit3aa09cc5af9cacba91915c095f9652ee5ed31ec7 (patch)
treef2de7ccaf499a16691ff20f40169f6373bda730b /testsuite/tests/th
parentf629442be93f4608e6bb53bfe2264a406230c546 (diff)
downloadhaskell-3aa09cc5af9cacba91915c095f9652ee5ed31ec7.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
Diffstat (limited to 'testsuite/tests/th')
-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 b3f72c8b92..cd80a6c4fb 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -418,6 +418,7 @@ test('T15243', normal, compile, ['-dsuppress-uniques'])
test('T15321', normal, compile_fail, [''])
test('T15324', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
test('T15331', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
+test('T15365', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
# Note: T9693 should be only_ways(['ghci']) once it's fixed.
test('T9693', expect_broken(9693), ghci_script, ['T9693.script'])
test('T14471', normal, compile, [''])