diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2019-11-10 11:35:38 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-11-13 07:08:40 -0500 |
commit | 9a939a6cdfb2a1357f9990af329096dff6b5be5c (patch) | |
tree | 15cf28073e50d4bbd72ba9de707542567f30dc68 /testsuite/tests/th | |
parent | b4b19d8990f345f8ae7fde130ba84327353433a9 (diff) | |
download | haskell-9a939a6cdfb2a1357f9990af329096dff6b5be5c.tar.gz |
Print name prefixly in the Outputable instance for StandaloneKindSig
Issue #17461 was occurring because the `Outputable` instance for
standalone kind signatures was simply calling `ppr` on the name in
the kind signature, which does not add parentheses to infix names.
The solution is simple: use `pprPrefixOcc` instead.
Fixes #17461.
Diffstat (limited to 'testsuite/tests/th')
-rw-r--r-- | testsuite/tests/th/T17461.hs | 10 | ||||
-rw-r--r-- | testsuite/tests/th/T17461.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 1 |
3 files changed, 18 insertions, 0 deletions
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']) |