Use captureTopConstraints in TcRnDriver calls

Authored by simonpj on Mar 7 2019, 3:09 AM.

Description

Use captureTopConstraints in TcRnDriver calls

Trac Trac #16376 showed the danger of failing to report an error
that exists only in the unsolved constraints, if an exception
is raised (via failM).

Well, the commit 5c1f268e (Fail fast in solveLocalEqualities)
did just that -- i.e. it found errors in the constraints, and
called failM to avoid a misleading cascade.

So we need to be sure to call captureTopConstraints to report
those insolubles. This was wrong in TcRnDriver.tcRnExpr and
in TcRnDriver.tcRnType.

As a result the error messages from test T13466 improved slightly,
a happy outcome.

Details

Committed
Marge Bot <ben+marge-bot@smart-cactus.org>Mar 8 2019, 5:08 AM
Parents
rGHC826282540492: Testsuite: use 'fragile' instead of 'skip' for T3424, T14697
Branches
Unknown
Tags
Unknown
Marge Bot <ben+marge-bot@smart-cactus.org> committed rGHC5be7ad7861c8: Use captureTopConstraints in TcRnDriver calls (authored by simonpj).Mar 8 2019, 5:08 AM