Use a correct substitution in tcInstType
authorBartosz Nitka <niteria@gmail.com>
Tue, 29 Mar 2016 10:41:59 +0000 (12:41 +0200)
committerBen Gamari <ben@smart-cactus.org>
Tue, 29 Mar 2016 10:42:05 +0000 (12:42 +0200)
commit73935326e0cf85ed077b9ab7dd8f197d39e2cd5b
tree722f436f497da36540c8d50c2c3ed3063fadb94a
parentaa611746aa860e1884c9ad623d6939791f2645ff
Use a correct substitution in tcInstType

`ty` doesn't have to be a closed type, so we need to add its
free vars to the in-scope set. They don't seem to be
available anywhere nearby, so we have to compute them.

Test Plan: ./validate

Reviewers: goldfire, austin, bgamari, simonpj

Reviewed By: simonpj

Subscribers: thomie, simonmar

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

GHC Trac Issues: #11371
compiler/typecheck/TcMType.hs