Build correct substitution in instDFunType
authorBartosz Nitka <niteria@gmail.com>
Tue, 29 Mar 2016 10:42:16 +0000 (12:42 +0200)
committerBen Gamari <ben@smart-cactus.org>
Tue, 29 Mar 2016 17:01:13 +0000 (19:01 +0200)
commit6b3927f5637e016d562ba59d046f1dc1edf7e08d
treee03a98b00fda84d5f1a334566e465b7e533c4889
parent1ca01bb8932b2c646ec1190ff854a1a3c456123e
Build correct substitution in instDFunType

We will use `ty` in the range of the substitution, hence
the substitution needs `ty`'s free vars in-scope.
They don't seem easily available by other means, so we
just compute them.

Test Plan: ./validate

Reviewers: austin, goldfire, bgamari, simonpj

Reviewed By: simonpj

Subscribers: thomie, simonmar

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

GHC Trac Issues: #11371

(cherry picked from commit a49228e3b6e3737da750bce59ec721b3b2f18eed)
compiler/typecheck/Inst.hs