summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T19759.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/th/T19759.hs')
-rw-r--r--testsuite/tests/th/T19759.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/th/T19759.hs b/testsuite/tests/th/T19759.hs
new file mode 100644
index 0000000000..96c1684a0b
--- /dev/null
+++ b/testsuite/tests/th/T19759.hs
@@ -0,0 +1,25 @@
+{-# LANGUAGE PatternSynonyms #-}
+{-# LANGUAGE TemplateHaskell #-}
+module T19759 where
+
+import Language.Haskell.TH
+
+data T a where
+ MkT :: a -> b -> T a
+
+{-
+pattern MkT' :: () => forall b. a -> b -> T a
+pattern MkT' x y = MkT x y
+-}
+
+$(do let mkT' = mkName "MkT'"
+ a <- newName "a"
+ b <- newName "b"
+ x <- newName "x"
+ y <- newName "y"
+ pure [ PatSynSigD mkT' $ ForallT [] [] $ ForallT [PlainTV b SpecifiedSpec] []
+ $ ArrowT `AppT` VarT a `AppT` (ArrowT `AppT` VarT b `AppT` (ConT ''T `AppT` VarT a))
+ , PatSynD mkT' (PrefixPatSyn [x, y]) ImplBidir $
+ ConP 'MkT [] [VarP x, VarP y]
+ ])
+