Fix #13885 by freshening reified GADT constructors' universal tyvars
authorRyan Scott <ryan.gl.scott@gmail.com>
Tue, 22 Aug 2017 13:28:56 +0000 (09:28 -0400)
committerRyan Scott <ryan.gl.scott@gmail.com>
Tue, 22 Aug 2017 13:28:56 +0000 (09:28 -0400)
commit79b259ae6a0a0c17568d7d03d82e378ad4c4001a
treedd2e517db55d20728aafa6259a6295f17a468969
parenta89bb806c58d3e601b37d6f2c4ebec6514fd2776
Fix #13885 by freshening reified GADT constructors' universal tyvars

Summary:
When reifying GADTs with Template Haskell, the universally quantified
type variables were being reused across both the data type head and the
constructors' type signatures. This had the annoying effect of causing sets
of differently scoped variables to have the same uniques. To avoid this, we
now freshen the universal tyvars before reifying the constructors so as to
ensure they have distinct uniques.

Test Plan: make test TEST=T13885

Reviewers: goldfire, austin, bgamari, simonpj

Reviewed By: simonpj

Subscribers: rwbarton, thomie

GHC Trac Issues: #13885

Differential Revision: https://phabricator.haskell.org/D3867
compiler/typecheck/TcSplice.hs
testsuite/tests/th/T13885.hs [new file with mode: 0644]
testsuite/tests/th/T13885.stdout [new file with mode: 0644]
testsuite/tests/th/all.T