Fix for recover with -fexternal-interpreter (#15418)
authorSimon Marlow <marlowsd@gmail.com>
Wed, 26 Sep 2018 20:32:29 +0000 (15:32 -0500)
committerBen Gamari <ben@smart-cactus.org>
Sat, 13 Oct 2018 17:26:18 +0000 (13:26 -0400)
commita04ecd7ba8c7f012369eeb5864b813a130e043e3
treea7e004dc6f3b1c43a4327e3543c959ae1726bd08
parent51c447936ef3f2f3f67c54d2dd62de537f443e89
Fix for recover with -fexternal-interpreter (#15418)

Summary:
When using -fexternal-interpreter, recover was not treating a Q
compuation that simply registered an error with addErrTc as failing.

Test Plan:
New unit tests:
* T15418 is the repro from in the ticket
* TH_recover_warns is a new test to ensure that we're keeping warnings when
  the body of recover succeeds.

Reviewers: bgamari, RyanGlScott, angerman, goldfire, erikd

Subscribers: rwbarton, carter

GHC Trac Issues: #15418

Differential Revision: https://phabricator.haskell.org/D5185

(cherry picked from commit d00c308633fe7d216d31a1087e00e63532d87d6d)
compiler/typecheck/TcSplice.hs
libraries/ghci/GHCi/Message.hs
libraries/ghci/GHCi/TH.hs
testsuite/tests/th/T15481.hs [new file with mode: 0644]
testsuite/tests/th/T15481.stderr [new file with mode: 0644]
testsuite/tests/th/TH_recover_warns.hs [new file with mode: 0644]
testsuite/tests/th/TH_recover_warns.stderr [new file with mode: 0644]
testsuite/tests/th/all.T