summaryrefslogtreecommitdiff
path: root/testsuite/tests/th
diff options
context:
space:
mode:
authorMario Blažević <blamario@protonmail.com>2022-08-13 17:50:24 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-08-22 22:06:21 -0400
commitb946232c328ed88fc34a7c83a335b2f5a4f777ed (patch)
tree3e65a5fac44f1f3987ae92f320c668b0d454996b /testsuite/tests/th
parentfb7c2d99f7df880b00b0d31ee7436c6d8eb3ba15 (diff)
downloadhaskell-b946232c328ed88fc34a7c83a335b2f5a4f777ed.tar.gz
Added pprType with precedence argument, as a prerequisite to fix issues #21723 and #21942.
* refines the precedence levels, adding `qualPrec` and `funPrec` to better control parenthesization * `pprParendType`, `pprFunArgType`, and `instance Ppr Type` all just call `pprType` with proper precedence * `ParensT` constructor is now always printed parenthesized * adds the precedence argument to `pprTyApp` as well, as it needs to keep track and pass it down * using `>=` instead of former `>` to match the Core type printing logic * some test outputs have changed, losing extraneous parentheses
Diffstat (limited to 'testsuite/tests/th')
-rw-r--r--testsuite/tests/th/T15845.stderr2
-rw-r--r--testsuite/tests/th/T9262.stderr2
-rw-r--r--testsuite/tests/th/TH_reifyExplicitForAllFams.stderr6
-rw-r--r--testsuite/tests/th/TH_unresolvedInfix.stdout4
4 files changed, 7 insertions, 7 deletions
diff --git a/testsuite/tests/th/T15845.stderr b/testsuite/tests/th/T15845.stderr
index 2b6a37e453..d83e6ad371 100644
--- a/testsuite/tests/th/T15845.stderr
+++ b/testsuite/tests/th/T15845.stderr
@@ -1,5 +1,5 @@
data family T15845.F1 (a_0 :: *) (b_1 :: *) :: *
-data instance forall (a_2 :: *) (b_3 :: *). T15845.F1 ([a_2]) b_3
+data instance forall (a_2 :: *) (b_3 :: *). T15845.F1 [a_2] b_3
= T15845.MkF1
data family T15845.F2 (a_0 :: *) :: *
data instance forall (a_1 :: *). T15845.F2 a_1 = T15845.MkF2
diff --git a/testsuite/tests/th/T9262.stderr b/testsuite/tests/th/T9262.stderr
index efdf5e3e09..8a18eadb2a 100644
--- a/testsuite/tests/th/T9262.stderr
+++ b/testsuite/tests/th/T9262.stderr
@@ -1 +1 @@
-instance GHC.Classes.Eq a_0 => GHC.Classes.Eq ([a_0])
+instance GHC.Classes.Eq a_0 => GHC.Classes.Eq [a_0]
diff --git a/testsuite/tests/th/TH_reifyExplicitForAllFams.stderr b/testsuite/tests/th/TH_reifyExplicitForAllFams.stderr
index be0bf5ad86..0fe28a5676 100644
--- a/testsuite/tests/th/TH_reifyExplicitForAllFams.stderr
+++ b/testsuite/tests/th/TH_reifyExplicitForAllFams.stderr
@@ -3,13 +3,13 @@ data instance forall (a_1 :: *). TH_reifyExplicitForAllFams.F (GHC.Maybe.Maybe a
= TH_reifyExplicitForAllFams.MkF a_1
class TH_reifyExplicitForAllFams.C (a_0 :: *)
where {type TH_reifyExplicitForAllFams.G (a_0 :: *) (b_1 :: *) :: *}
-instance TH_reifyExplicitForAllFams.C ([a_2])
+instance TH_reifyExplicitForAllFams.C [a_2]
type family TH_reifyExplicitForAllFams.G (a_0 :: *) (b_1 :: *) :: *
type instance forall (a_2 :: *)
- (b_3 :: *). TH_reifyExplicitForAllFams.G ([a_2])
+ (b_3 :: *). TH_reifyExplicitForAllFams.G [a_2]
b_3 = Data.Proxy.Proxy b_3
type family TH_reifyExplicitForAllFams.H (a_0 :: *) (b_1 :: *) :: * where
- forall (x_2 :: *) (y_3 :: *). TH_reifyExplicitForAllFams.H ([x_2])
+ forall (x_2 :: *) (y_3 :: *). TH_reifyExplicitForAllFams.H [x_2]
(Data.Proxy.Proxy y_3) = Data.Either.Either x_2
y_3
forall (z_4 :: *). TH_reifyExplicitForAllFams.H z_4
diff --git a/testsuite/tests/th/TH_unresolvedInfix.stdout b/testsuite/tests/th/TH_unresolvedInfix.stdout
index 3953685881..b319840a08 100644
--- a/testsuite/tests/th/TH_unresolvedInfix.stdout
+++ b/testsuite/tests/th/TH_unresolvedInfix.stdout
@@ -44,5 +44,5 @@ N :+ (N :+ N :+ N)
(N)
N :+ (N :+ N :+ N)
(N)
-(Int + (Int + Int + Int))
-Int
+Int + (Int + (Int + Int))
+(Int)