diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2016-11-13 16:17:37 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-11-13 16:17:38 -0500 |
commit | 6c0f10fac767c49b65ed71e8eb8e78ca4f9062d5 (patch) | |
tree | 4d37b9d01c1bf38d6356471ddb99ca4327e945c6 /testsuite | |
parent | 8cb7bc5c234eb8168068f65b8888597106fec302 (diff) | |
download | haskell-6c0f10fac767c49b65ed71e8eb8e78ca4f9062d5.tar.gz |
Kill Type pretty-printer
Here we consolidate the pretty-printing logic for types in IfaceType. We
need IfaceType regardless and the printer for Type can be implemented in
terms of that for IfaceType. See #11660.
Note that this is very much a work-in-progress. Namely I still have yet
to ponder how to ease the hs-boot file situation, still need to rip out
more dead code, need to move some of the special cases for, e.g., `*` to
the IfaceType printer, and need to get it to validate. That being said,
it comes close to validating as-is.
Test Plan: Validate
Reviewers: goldfire, austin
Subscribers: goldfire, thomie, simonpj
Differential Revision: https://phabricator.haskell.org/D2528
GHC Trac Issues: #11660
Diffstat (limited to 'testsuite')
16 files changed, 42 insertions, 43 deletions
diff --git a/testsuite/tests/deSugar/should_compile/T2431.stderr b/testsuite/tests/deSugar/should_compile/T2431.stderr index 43ffb06033..ff1047db84 100644 --- a/testsuite/tests/deSugar/should_compile/T2431.stderr +++ b/testsuite/tests/deSugar/should_compile/T2431.stderr @@ -17,7 +17,7 @@ T2431.$WRefl = T2431.Refl @ a @ a @~ (<a>_N :: (a :: *) GHC.Prim.~# (a :: *)) -- RHS size: {terms: 4, types: 8, coercions: 0} -absurd :: forall a. Int :~: Bool -> a +absurd :: forall a. (Int :~: Bool) -> a [GblId, Arity=1, Caf=NoCafRefs, Str=<L,U>x] absurd = \ (@ a) (x :: Int :~: Bool) -> case x of { } diff --git a/testsuite/tests/dependent/should_fail/TypeSkolEscape.stderr b/testsuite/tests/dependent/should_fail/TypeSkolEscape.stderr index 963dcbb6a3..88539858cf 100644 --- a/testsuite/tests/dependent/should_fail/TypeSkolEscape.stderr +++ b/testsuite/tests/dependent/should_fail/TypeSkolEscape.stderr @@ -2,6 +2,6 @@ TypeSkolEscape.hs:8:1: error: • Quantified type's kind mentions quantified type variable (skolem escape) - type: forall a1. a1 + type: forall (a1 :: TYPE v1). a1 of kind: TYPE v • In the type synonym declaration for ‘Bad’ diff --git a/testsuite/tests/ghci/scripts/T11252.stdout b/testsuite/tests/ghci/scripts/T11252.stdout index eddba4530e..f6d45ddf32 100644 --- a/testsuite/tests/ghci/scripts/T11252.stdout +++ b/testsuite/tests/ghci/scripts/T11252.stdout @@ -1 +1 @@ -Proxy1 :: forall k -> k -> * +Proxy1 :: k -> * diff --git a/testsuite/tests/ghci/scripts/T2766.stdout b/testsuite/tests/ghci/scripts/T2766.stdout index 5bcbd9e75e..f8ee42ff6a 100644 --- a/testsuite/tests/ghci/scripts/T2766.stdout +++ b/testsuite/tests/ghci/scripts/T2766.stdout @@ -1,3 +1,3 @@ first :: Arrow to => b `to` c -> (b, d) `to` (c, d) :: Arrow to => to b c -> to (b, d) (c, d) -first :: b~>c -> (b, d)~>(c, d) :: b ~> c -> (b, d) ~> (c, d) +first :: b~>c -> (b, d)~>(c, d) :: (b ~> c) -> (b, d) ~> (c, d) diff --git a/testsuite/tests/ghci/scripts/ghci059.stdout b/testsuite/tests/ghci/scripts/ghci059.stdout index 3cb103c9f5..9f4e65b344 100644 --- a/testsuite/tests/ghci/scripts/ghci059.stdout +++ b/testsuite/tests/ghci/scripts/ghci059.stdout @@ -1,4 +1,4 @@ type role Coercible representational representational -class a ~R# b => Coercible (a :: k0) (b :: k0) +class Coercible a b => Coercible (a :: k0) (b :: k0) -- Defined in ‘GHC.Types’ coerce :: Coercible a b => a -> b -- Defined in ‘GHC.Prim’ diff --git a/testsuite/tests/roles/should_compile/T8958.stderr b/testsuite/tests/roles/should_compile/T8958.stderr index df20e67f3a..5369daa5cd 100644 --- a/testsuite/tests/roles/should_compile/T8958.stderr +++ b/testsuite/tests/roles/should_compile/T8958.stderr @@ -65,8 +65,7 @@ AbsBinds [a] [] Exported types: T8958.$fRepresentationala [InlPrag=[ALWAYS] CONLIKE] :: forall a. Representational a [LclIdX[DFunId], - Unf=DFun: \ (@ a[ssk:2]) -> - T8958.C:Representational TYPE: a[ssk:2]] + Unf=DFun: \ (@ a) -> T8958.C:Representational TYPE: a] Binds: $dRepresentational = T8958.C:Representational @ a Evidence: [EvBinds{}]} AbsBinds [a] [] @@ -74,8 +73,7 @@ AbsBinds [a] [] wrap: <>] Exported types: T8958.$fNominala [InlPrag=[ALWAYS] CONLIKE] :: forall a. Nominal a - [LclIdX[DFunId], - Unf=DFun: \ (@ a[ssk:2]) -> T8958.C:Nominal TYPE: a[ssk:2]] + [LclIdX[DFunId], Unf=DFun: \ (@ a) -> T8958.C:Nominal TYPE: a] Binds: $dNominal = T8958.C:Nominal @ a Evidence: [EvBinds{}]} diff --git a/testsuite/tests/typecheck/should_compile/T10632.stderr b/testsuite/tests/typecheck/should_compile/T10632.stderr index 1733f0ae7a..0796146b17 100644 --- a/testsuite/tests/typecheck/should_compile/T10632.stderr +++ b/testsuite/tests/typecheck/should_compile/T10632.stderr @@ -1,5 +1,5 @@ T10632.hs:4:1: warning: [-Wredundant-constraints] - • Redundant constraint: ?file1::String + • Redundant constraint: (?file1::String) • In the type signature for: f :: (?file1::String) => IO () diff --git a/testsuite/tests/typecheck/should_fail/ClassOperator.stderr b/testsuite/tests/typecheck/should_fail/ClassOperator.stderr index 29ac2d240d..30791286c2 100644 --- a/testsuite/tests/typecheck/should_fail/ClassOperator.stderr +++ b/testsuite/tests/typecheck/should_fail/ClassOperator.stderr @@ -1,7 +1,7 @@ ClassOperator.hs:12:3: error: • Could not deduce (a ><> b0) - from the context: a ><> b + from the context: (a ><> b) bound by the type signature for: (**>) :: (a ><> b) => a -> a -> () at ClassOperator.hs:12:3-44 @@ -14,7 +14,7 @@ ClassOperator.hs:12:3: error: ClassOperator.hs:12:3: error: • Could not deduce (a ><> b0) - from the context: a ><> b + from the context: (a ><> b) bound by the type signature for: (**<) :: (a ><> b) => a -> a -> () at ClassOperator.hs:12:3-44 @@ -27,7 +27,7 @@ ClassOperator.hs:12:3: error: ClassOperator.hs:12:3: error: • Could not deduce (a ><> b0) - from the context: a ><> b + from the context: (a ><> b) bound by the type signature for: (>**) :: (a ><> b) => a -> a -> () at ClassOperator.hs:12:3-44 @@ -40,7 +40,7 @@ ClassOperator.hs:12:3: error: ClassOperator.hs:12:3: error: • Could not deduce (a ><> b0) - from the context: a ><> b + from the context: (a ><> b) bound by the type signature for: (<**) :: (a ><> b) => a -> a -> () at ClassOperator.hs:12:3-44 diff --git a/testsuite/tests/typecheck/should_fail/IPFail.stderr b/testsuite/tests/typecheck/should_fail/IPFail.stderr index 72c11b0c0d..0ba5bce32a 100644 --- a/testsuite/tests/typecheck/should_fail/IPFail.stderr +++ b/testsuite/tests/typecheck/should_fail/IPFail.stderr @@ -1,7 +1,7 @@ IPFail.hs:6:18: error: • Could not deduce (Num Bool) arising from the literal ‘5’ - from the context: ?x::Int + from the context: (?x::Int) bound by the type signature for: f0 :: (?x::Int) => () -> Bool at IPFail.hs:5:1-31 diff --git a/testsuite/tests/typecheck/should_fail/T7019a.stderr b/testsuite/tests/typecheck/should_fail/T7019a.stderr index a50fbcf240..9772b85e58 100644 --- a/testsuite/tests/typecheck/should_fail/T7019a.stderr +++ b/testsuite/tests/typecheck/should_fail/T7019a.stderr @@ -2,6 +2,6 @@ T7019a.hs:11:1: error: • Illegal polymorphic type: forall b. Context (Associated a b) A constraint must be a monotype - • In the context: forall b. Context (Associated a b) + • In the context: (forall b. Context (Associated a b)) While checking the super-classes of class ‘Class’ In the class declaration for ‘Class’ diff --git a/testsuite/tests/typecheck/should_fail/T7525.stderr b/testsuite/tests/typecheck/should_fail/T7525.stderr index 4d6f8d3a90..99b9c2861d 100644 --- a/testsuite/tests/typecheck/should_fail/T7525.stderr +++ b/testsuite/tests/typecheck/should_fail/T7525.stderr @@ -1,9 +1,9 @@ -T7525.hs:5:30: - Could not deduce: ?b::Bool - arising from a use of implicit parameter ‘?b’ - from the context: ?a::Bool - bound by the implicit-parameter binding for ?a at T7525.hs:5:7-31 - In the second argument of ‘(&&)’, namely ‘?b’ - In the expression: ?a && ?b - In the expression: let ?a = True in ?a && ?b +T7525.hs:5:30: error: + • Could not deduce: (?b::Bool) + arising from a use of implicit parameter ‘?b’ + from the context: (?a::Bool) + bound by the implicit-parameter binding for ?a at T7525.hs:5:7-31 + • In the second argument of ‘(&&)’, namely ‘?b’ + In the expression: ?a && ?b + In the expression: let ?a = True in ?a && ?b diff --git a/testsuite/tests/typecheck/should_fail/T8912.stderr b/testsuite/tests/typecheck/should_fail/T8912.stderr index 4e4515e7a1..78fdd108dd 100644 --- a/testsuite/tests/typecheck/should_fail/T8912.stderr +++ b/testsuite/tests/typecheck/should_fail/T8912.stderr @@ -1,6 +1,6 @@ -T8912.hs:7:10: - Illegal implicit parameter ‘?imp::Int’ - In the context: ?imp::Int - While checking an instance declaration - In the instance declaration for ‘C [a]’ +T8912.hs:7:10: error: + • Illegal implicit parameter ‘?imp::Int’ + • In the context: (?imp::Int) + While checking an instance declaration + In the instance declaration for ‘C [a]’ diff --git a/testsuite/tests/typecheck/should_fail/tcfail041.stderr b/testsuite/tests/typecheck/should_fail/tcfail041.stderr index fe116b5277..d2d3214d9e 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail041.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail041.stderr @@ -1,6 +1,6 @@ -tcfail041.hs:5:1: - Illegal implicit parameter ‘?imp::Int’ - In the context: ?imp::Int - While checking the super-classes of class ‘D’ - In the class declaration for ‘D’ +tcfail041.hs:5:1: error: + • Illegal implicit parameter ‘?imp::Int’ + • In the context: (?imp::Int) + While checking the super-classes of class ‘D’ + In the class declaration for ‘D’ diff --git a/testsuite/tests/typecheck/should_fail/tcfail130.stderr b/testsuite/tests/typecheck/should_fail/tcfail130.stderr index 7640031cbd..51f77d14c6 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail130.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail130.stderr @@ -1,5 +1,6 @@ -tcfail130.hs:10:7: - Unbound implicit parameter ?x::Int arising from a use of ‘woggle’ - In the expression: woggle 3 - In an equation for ‘foo’: foo = woggle 3 +tcfail130.hs:10:7: error: + • Unbound implicit parameter (?x::Int) + arising from a use of ‘woggle’ + • In the expression: woggle 3 + In an equation for ‘foo’: foo = woggle 3 diff --git a/testsuite/tests/typecheck/should_fail/tcfail211.stderr b/testsuite/tests/typecheck/should_fail/tcfail211.stderr index 7a5053a092..a88cc35507 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail211.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail211.stderr @@ -1,12 +1,12 @@ tcfail211.hs:5:1: error: • Illegal implicit parameter ‘?imp::Int’ - • In the context: ?imp::Int + • In the context: (?imp::Int) While checking the super-classes of class ‘D’ In the class declaration for ‘D’ tcfail211.hs:8:10: error: • Illegal implicit parameter ‘?imp::Int’ - • In the context: ?imp::Int + • In the context: (?imp::Int) While checking an instance declaration In the instance declaration for ‘D Int’ diff --git a/testsuite/tests/typecheck/should_run/tcrun045.stderr b/testsuite/tests/typecheck/should_run/tcrun045.stderr index f6b1652e5b..19fca1096f 100644 --- a/testsuite/tests/typecheck/should_run/tcrun045.stderr +++ b/testsuite/tests/typecheck/should_run/tcrun045.stderr @@ -1,18 +1,18 @@ tcrun045.hs:11:10: error: • Illegal implicit parameter ‘?imp::Int’ - • In the context: ?imp::Int + • In the context: (?imp::Int) While checking an instance declaration In the instance declaration for ‘C Int’ tcrun045.hs:24:1: error: • Illegal implicit parameter ‘?imp::Int’ - • In the context: ?imp::Int + • In the context: (?imp::Int) While checking the super-classes of class ‘D’ In the class declaration for ‘D’ tcrun045.hs:27:10: error: • Illegal implicit parameter ‘?imp::Int’ - • In the context: ?imp::Int + • In the context: (?imp::Int) While checking an instance declaration In the instance declaration for ‘D Int’ |