Fix scoped type variables in TH for several constructs
authorHE, Tao <sighingnow@gmail.com>
Sun, 25 Mar 2018 19:34:45 +0000 (15:34 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 25 Mar 2018 20:08:33 +0000 (16:08 -0400)
commita3986d7fa59d96a77ac0f25bcf1dcf96b8746994
tree2580e209c25667fc18a7cb48d811ff507cb8fea3
parent0cbb13b3dfd70b4c9665109cd6c4a150cb7b99df
Fix scoped type variables in TH for several constructs

Namely class methods, default signatures and pattern synonyms.

When scoped type variables occur inside class default methods,
default signatures and pattern synonyms, avoid re-create explicit
type variables when represent the type signatures.

This patch should fix Trac#14885.

Signed-off-by: HE, Tao <sighingnow@gmail.com>
Test Plan: make test TEST="T14885a T14885b T14885c"

Reviewers: goldfire, bgamari, simonpj, RyanGlScott

Reviewed By: simonpj, RyanGlScott

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14885

Differential Revision: https://phabricator.haskell.org/D4469
compiler/deSugar/DsMeta.hs
docs/users_guide/8.6.1-notes.rst
testsuite/tests/th/T14885a.hs [new file with mode: 0644]
testsuite/tests/th/T14885b.hs [new file with mode: 0644]
testsuite/tests/th/T14885c.hs [new file with mode: 0644]
testsuite/tests/th/T7064.stdout
testsuite/tests/th/all.T