Clone relevant constraints to avoid side-effects on HoleDests. Fixes #15370.
authorMatthías Páll Gissurarson <mpg@mpg.is>
Tue, 24 Jul 2018 21:57:48 +0000 (23:57 +0200)
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>
Tue, 24 Jul 2018 21:58:57 +0000 (23:58 +0200)
commit0dc86f6bc454253969dedc31bed477eded4cf82d
treeb6509c97086e3467155ebd32e925dae3bb5aab17
parent47561c917deb8818161cd73a11a17582ba38c2de
Clone relevant constraints to avoid side-effects on HoleDests. Fixes #15370.

Summary: When looking for valid hole fits, the constraints relevant
to the hole may sometimes contain a HoleDest. Previously,
these were not cloned, which could cause the filling of filled
coercion hole being, which would cause an assert to fail. This is now fixed.

Test Plan: Regression test included.

Reviewers: simonpj, bgamari, goldfire

Reviewed By: simonpj

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15370

Differential Revision: https://phabricator.haskell.org/D5004
compiler/typecheck/TcHoleErrors.hs
compiler/typecheck/TcMType.hs
testsuite/tests/typecheck/should_compile/T15370.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T15370.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T