summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/th/T20773.script17
-rw-r--r--testsuite/tests/th/T20773.stdout6
-rw-r--r--testsuite/tests/th/all.T1
3 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/th/T20773.script b/testsuite/tests/th/T20773.script
new file mode 100644
index 0000000000..9b71d0926e
--- /dev/null
+++ b/testsuite/tests/th/T20773.script
@@ -0,0 +1,17 @@
+:seti -XDataKinds -XTemplateHaskell
+import Language.Haskell.TH
+import Data.Proxy
+
+data (:::) = forall k k' . k ::: k'; infixr 5 :::
+
+intT = ConT ''Int
+stringT = ConT ''String
+boolT = ConT ''Bool
+
+:t Proxy @($(pure $ UInfixT intT '(:::) stringT))
+
+promUInf x y = PromotedUInfixT x (mkName ":::") y
+:t Proxy @($(pure $ (intT `promUInf` stringT) `promUInf` boolT))
+
+promInf x y = PromotedInfixT x (mkName ":::") y
+:t Proxy @($(pure $ (intT `promInf` stringT) `promInf` boolT))
diff --git a/testsuite/tests/th/T20773.stdout b/testsuite/tests/th/T20773.stdout
new file mode 100644
index 0000000000..ea8c61726d
--- /dev/null
+++ b/testsuite/tests/th/T20773.stdout
@@ -0,0 +1,6 @@
+Proxy @($(pure $ UInfixT intT '(:::) stringT))
+ :: Proxy (Int '::: String)
+Proxy @($(pure $ (intT `promUInf` stringT) `promUInf` boolT))
+ :: Proxy (Int '::: (String '::: Bool))
+Proxy @($(pure $ (intT `promInf` stringT) `promInf` boolT))
+ :: Proxy ((Int '::: String) '::: Bool)
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index 439e88cd9a..cfd40a40df 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -538,3 +538,4 @@ test('T17820c', normal, compile_fail, [''])
test('T17820d', normal, compile_fail, [''])
test('T17820e', normal, compile_fail, [''])
test('T20590', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
+test('T20773', only_ways(['ghci']), ghci_script, ['T20773.script'])