[commit: ghc] master: Don't quantify implicit type variables when quoting type signatures in TH (729a5e4)
git at git.haskell.org
git at git.haskell.org
Mon Jan 23 14:16:57 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/729a5e452db530e8da8ca163fcd842faac6bd690/ghc
>---------------------------------------------------------------
commit 729a5e452db530e8da8ca163fcd842faac6bd690
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date: Mon Jan 23 09:06:04 2017 -0500
Don't quantify implicit type variables when quoting type signatures in TH
Summary:
A bug was introduced in GHC 8.0 in which Template Haskell-quoted type
signatures would quantify _all_ their type variables, even the implicit ones.
This would cause splices like this:
```
$([d| idProxy :: forall proxy (a :: k). proxy a -> proxy a
idProxy x = x
|])
```
To splice back in something that was slightly different:
```
idProxy :: forall k proxy (a :: k). proxy a -> proxy a
idProxy x = x
```
Notice that the kind variable `k` is now explicitly quantified! What's worse,
this now requires the `TypeInType` extension to be enabled.
This changes the behavior of Template Haskell quoting to never explicitly
quantify type variables which are implicitly quantified in the source.
There are some other places where this behavior pops up too, including
class methods, type ascriptions, `SPECIALIZE` pragmas, foreign imports,
and pattern synonynms (#13018), so I fixed those too.
Fixes #13018 and #13123.
Test Plan: ./validate
Reviewers: simonpj, goldfire, austin, bgamari
Reviewed By: simonpj, goldfire
Subscribers: simonpj, mpickering, thomie
Differential Revision: https://phabricator.haskell.org/D2974
GHC Trac Issues: #13018, #13123
>---------------------------------------------------------------
729a5e452db530e8da8ca163fcd842faac6bd690
compiler/deSugar/DsMeta.hs | 80 ++++++++++++++++++++----------
docs/users_guide/8.2.1-notes.rst | 36 ++++++++++++++
testsuite/tests/ghci/scripts/T11098.stdout | 2 +-
testsuite/tests/th/T10828.stderr | 12 ++---
testsuite/tests/th/T11797.stderr | 2 +-
testsuite/tests/th/T13018.hs | 11 ++++
testsuite/tests/th/T13123.hs | 30 +++++++++++
testsuite/tests/th/T5217.stderr | 6 +--
testsuite/tests/th/T7064.stdout | 2 +-
testsuite/tests/th/T8625.stdout | 2 +-
testsuite/tests/th/TH_RichKinds2.stderr | 7 ++-
testsuite/tests/th/TH_pragma.stderr | 2 +-
testsuite/tests/th/all.T | 2 +
13 files changed, 151 insertions(+), 43 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 729a5e452db530e8da8ca163fcd842faac6bd690
More information about the ghc-commits
mailing list