diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2020-04-13 16:31:01 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-04-15 17:48:47 -0400 |
commit | 22cc8e513fcfa89a4391f075534d903596a05895 (patch) | |
tree | 9b48848713d570430bde44f4aaea7319500c25f7 /testsuite/tests/printer | |
parent | 0b934e30417a767063625494ecf135c9d6006f71 (diff) | |
download | haskell-22cc8e513fcfa89a4391f075534d903596a05895.tar.gz |
Fix #18052 by using pprPrefixOcc in more places
This fixes several small oversights in the choice of pretty-printing
function to use. Fixes #18052.
Diffstat (limited to 'testsuite/tests/printer')
-rw-r--r-- | testsuite/tests/printer/T18052a.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/printer/T18052a.stderr | 42 | ||||
-rw-r--r-- | testsuite/tests/printer/all.T | 2 |
3 files changed, 52 insertions, 0 deletions
diff --git a/testsuite/tests/printer/T18052a.hs b/testsuite/tests/printer/T18052a.hs new file mode 100644 index 0000000000..6cf5a374be --- /dev/null +++ b/testsuite/tests/printer/T18052a.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE TypeOperators #-} +module T18052a where + +(+++) = (++) +pattern x :||: y = (x,y) +type (^^^) = Either +data (&&&) diff --git a/testsuite/tests/printer/T18052a.stderr b/testsuite/tests/printer/T18052a.stderr new file mode 100644 index 0000000000..1ac260a73b --- /dev/null +++ b/testsuite/tests/printer/T18052a.stderr @@ -0,0 +1,42 @@ +TYPE SIGNATURES + (+++) :: forall {a}. [a] -> [a] -> [a] +TYPE CONSTRUCTORS + data type (&&&){0} :: * + type synonym (^^^){0} :: * -> * -> * +PATTERN SYNONYMS + (:||:) :: forall {a} {b}. a -> b -> (a, b) +Dependent modules: [] +Dependent packages: [base-4.14.0.0, ghc-prim-0.6.1, + integer-gmp-1.0.3.0] + +==================== Tidy Core ==================== +Result size of Tidy Core + = {terms: 18, types: 53, coercions: 0, joins: 0/0} + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +T18052a.$b:||: :: forall {a} {b}. a -> b -> (a, b) +[GblId, Arity=2, Unf=OtherCon []] +T18052a.$b:||: = GHC.Tuple.(,) + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +(+++) :: forall {a}. [a] -> [a] -> [a] +[GblId] +(+++) = (++) + +-- RHS size: {terms: 13, types: 20, coercions: 0, joins: 0/0} +T18052a.$m:||: + :: forall {rep :: GHC.Types.RuntimeRep} {r :: TYPE rep} {a} {b}. + (a, b) -> (a -> b -> r) -> (GHC.Prim.Void# -> r) -> r +[GblId, Arity=3, Unf=OtherCon []] +T18052a.$m:||: + = \ (@(rep :: GHC.Types.RuntimeRep)) + (@(r :: TYPE rep)) + (@a) + (@b) + (scrut :: (a, b)) + (cont :: a -> b -> r) + _ [Occ=Dead] -> + case scrut of { (x, y) -> cont x y } + + + diff --git a/testsuite/tests/printer/all.T b/testsuite/tests/printer/all.T index d476927406..597f83aa9c 100644 --- a/testsuite/tests/printer/all.T +++ b/testsuite/tests/printer/all.T @@ -57,3 +57,5 @@ test('T14306', ignore_stderr, makefile_test, ['T14306']) test('T14343', normal, compile_fail, ['']) test('T14343b', normal, compile_fail, ['']) test('T15761', normal, compile_fail, ['']) +test('T18052a', normal, compile, + ['-ddump-simpl -ddump-types -dno-typeable-binds -dsuppress-uniques']) |