Suppress redundant givens during error reporting
authorRyan Scott <ryan.gl.scott@gmail.com>
Sun, 12 Aug 2018 15:27:27 +0000 (17:27 +0200)
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>
Sun, 12 Aug 2018 15:27:27 +0000 (17:27 +0200)
commitc552feea127d8ed8cbf4994a157c4bbe254b96c3
tree6a127b7a4da617b89f495da91a3978582bb77af7
parentf7f9820e8f5601e9a072e504f3d772fd78df6700
Suppress redundant givens during error reporting

Summary:
When GHC reports that it cannot solve a constraint in error
messages, it often reports what given constraints it has in scope.
Unfortunately, sometimes redundant constraints (like `* ~ *`, from
#15361) can sneak in. The fix is simple: blast away these redundant
constraints using `mkMinimalBySCs`.

Test Plan: make test TEST=T15361

Reviewers: simonpj, bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15361

Differential Revision: https://phabricator.haskell.org/D5002
compiler/typecheck/TcErrors.hs
testsuite/tests/typecheck/should_fail/T15361.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T15361.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T5853.stderr
testsuite/tests/typecheck/should_fail/all.T