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)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 24 Oct 2018 15:38:55 +0000 (16:38 +0100)
commit6b1102e2cfcffb265fd33cf8a99ab5e6b3f14906
tree564e90f34ac188a0fc22390f3975572007cf6b7b
parent7d9036448a394d7f2eeb158bb71d0fa694f88f56
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.
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcRnTypes.hs
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