summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/GHC/Hs/Decls.hs3
-rw-r--r--testsuite/tests/th/T17461.hs10
-rw-r--r--testsuite/tests/th/T17461.stderr7
-rw-r--r--testsuite/tests/th/all.T1
4 files changed, 20 insertions, 1 deletions
diff --git a/compiler/GHC/Hs/Decls.hs b/compiler/GHC/Hs/Decls.hs
index f095a3ffeb..2146cc0c07 100644
--- a/compiler/GHC/Hs/Decls.hs
+++ b/compiler/GHC/Hs/Decls.hs
@@ -1471,7 +1471,8 @@ instance OutputableBndrId p
instance OutputableBndrId p
=> Outputable (StandaloneKindSig (GhcPass p)) where
- ppr (StandaloneKindSig _ v ki) = text "type" <+> ppr v <+> text "::" <+> ppr ki
+ ppr (StandaloneKindSig _ v ki)
+ = text "type" <+> pprPrefixOcc (unLoc v) <+> text "::" <+> ppr ki
ppr (XStandaloneKindSig nec) = noExtCon nec
instance Outputable NewOrData where
diff --git a/testsuite/tests/th/T17461.hs b/testsuite/tests/th/T17461.hs
new file mode 100644
index 0000000000..d331a58166
--- /dev/null
+++ b/testsuite/tests/th/T17461.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE StandaloneKindSignatures #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeOperators #-}
+module T17461 where
+
+import Data.Kind
+
+$([d| type (:+:) :: Type -> Type -> Type
+ type (:+:) = Either
+ |])
diff --git a/testsuite/tests/th/T17461.stderr b/testsuite/tests/th/T17461.stderr
new file mode 100644
index 0000000000..cc730400bf
--- /dev/null
+++ b/testsuite/tests/th/T17461.stderr
@@ -0,0 +1,7 @@
+T17461.hs:(8,3)-(10,6): Splicing declarations
+ [d| type (:+:) :: Type -> Type -> Type
+
+ type (:+:) = Either |]
+ ======>
+ type (:+:) :: Type -> Type -> Type
+ type (:+:) = Either
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index a75703dd83..b63b0ceb01 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -491,3 +491,4 @@ test('T17380', normal, compile_fail, [''])
test('T17394', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
test('T17379a', normal, compile_fail, [''])
test('T17379b', normal, compile_fail, [''])
+test('T17461', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])