diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-05-16 12:11:37 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-05-16 12:58:29 -0400 |
commit | 99f8cc84a5b23878b3b0732955cb651bc973e9f2 (patch) | |
tree | 4dc7d2d1061f99a2a29a6e6b8f4492dbd8e54c23 /testsuite/tests/patsyn | |
parent | 126b4125d95f7e4d272a9307cb8b634b11bd337f (diff) | |
download | haskell-99f8cc84a5b23878b3b0732955cb651bc973e9f2.tar.gz |
Fix #15039 by pretty-printing equalities more systematically
GHC previously had a handful of special cases for
pretty-printing equalities in a more user-friendly manner, but they
were far from comprehensive (see #15039 for an example of where this
fell apart).
This patch makes the pretty-printing of equalities much more
systematic. I've adopted the approach laid out in
https://ghc.haskell.org/trac/ghc/ticket/15039#comment:4, and updated
`Note [Equality predicates in IfaceType]` accordingly. We are now
more careful to respect the properties of the
`-fprint-explicit-kinds` and `-fprint-equality-relations` flags,
which led to some improvements in error message outputs.
Along the way, I also tweaked the error-reporting machinery not to
print out the type of a typed hole when the type is an unlifted
equality, since it's kind (`TYPE ('TupleRep '[])`) was more
confusing than anything.
Test Plan: make test TEST="T15039a T15039b T15039c T15039d"
Reviewers: simonpj, goldfire, bgamari
Reviewed By: simonpj
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #15039
Differential Revision: https://phabricator.haskell.org/D4696
Diffstat (limited to 'testsuite/tests/patsyn')
-rw-r--r-- | testsuite/tests/patsyn/should_compile/T14394.stdout | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/patsyn/should_compile/T14394.stdout b/testsuite/tests/patsyn/should_compile/T14394.stdout index 6495f9ee35..557b8f4a74 100644 --- a/testsuite/tests/patsyn/should_compile/T14394.stdout +++ b/testsuite/tests/patsyn/should_compile/T14394.stdout @@ -3,7 +3,7 @@ pattern Foo :: () => (b ~ a) => a :~~: b pattern Bar :: forall k2 k1 (a :: k1) (b :: k2). () => - (k2 ~ k1, (b :: k2) ~~ (a :: k1)) => + (k2 ~ k1, b ~~ a) => a :~~: b -- Defined at <interactive>:11:1 pattern Bam :: () => Ord a => a -> a -> (S a, S a) |