Report a Wanted error even if there are Given ones
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 18 Oct 2018 14:41:44 +0000 (15:41 +0100)
committerBen Gamari <ben@smart-cactus.org>
Tue, 30 Oct 2018 18:58:32 +0000 (14:58 -0400)
commita49f95c29b3a5f665b3ec0f1f05d78b73244b1f1
tree55ba980f5400feffaeb566469d8cfa42e6985170
parentb391cae1c2b0d27425c2f0cd24d627e2742bfbed
Report a Wanted error even if there are Given ones

We suppress some Given errors; see Note [Given errors]
in TcErrors.  But we must be careful not to suppress
Wanted errors because of the presence of these Given
errors -- else we might allow compilation to bogusly
proceed

The rubber hits the road in TcRnTypes.insolubleCt,
where we don't want to treat Givens as insoluble,
nor (and this is the new bit) Deriveds that arise
from Givens.  See Note [Given insolubles] in TcRnTypes.

This fixes #15767.

(cherry picked from commit 6b1102e2cfcffb265fd33cf8a99ab5e6b3f14906)

Ben notes:

  I have folded some test output changes in `TEST="T12529 T12921 mc13
  mc14"` into this patch that were not in the original.
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcRnTypes.hs
testsuite/tests/rename/should_fail/mc13.stderr
testsuite/tests/rename/should_fail/mc14.stderr
testsuite/tests/typecheck/should_fail/T12529.stderr
testsuite/tests/typecheck/should_fail/T12921.stderr
testsuite/tests/typecheck/should_fail/T15767.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T15767.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T