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 10:42:17 +0000 (12:42 +0200)
commita49228e3b6e3737da750bce59ec721b3b2f18eed
treebf8937fe08b43e1d5c3aad9fc15cbbe82b14f9ef
parent73935326e0cf85ed077b9ab7dd8f197d39e2cd5b
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
compiler/typecheck/Inst.hs