[commit: ghc] wip/exp-pat-frame: Fix #16293 by cleaning up Proxy# infelicities (012257c)

git at git.haskell.org git at git.haskell.org
Wed Feb 13 08:49:45 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/exp-pat-frame
Link       : http://ghc.haskell.org/trac/ghc/changeset/012257c15f584069500af2953ab70856f9a1470e/ghc

>---------------------------------------------------------------

commit 012257c15f584069500af2953ab70856f9a1470e
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Sat Feb 9 09:50:42 2019 -0500

    Fix #16293 by cleaning up Proxy# infelicities
    
    This bug fixes three problems related to `Proxy#`/`proxy#`:
    
    1. Reifying it with TH claims that the `Proxy#` type constructor has
       two arguments, but that ought to be one for consistency with
       TH's treatment for other primitive type constructors like `(->)`.
       This was fixed by just returning the number of
       `tyConVisibleTyVars` instead of using `tyConArity` (which includes
       invisible arguments).
    2. The role of `Proxy#`'s visible argument was hard-coded as nominal.
       Easily fixed by changing it to phantom.
    3. The visibility of `proxy#`'s kind argument was specified, which
       is different from the `Proxy` constructor (which treats it as
       inferred). Some minor refactoring in `proxyHashId` fixed ths up.
    
       Along the way, I had to introduce a `mkSpecForAllTy` function, so
       I did some related Haddock cleanup in `Type`, where that function
       lives.


>---------------------------------------------------------------

012257c15f584069500af2953ab70856f9a1470e
 compiler/basicTypes/MkId.hs                       | 12 ++++++++----
 compiler/prelude/TysPrim.hs                       | 10 +++++-----
 compiler/typecheck/TcSplice.hs                    |  3 ++-
 compiler/types/Type.hs                            | 24 ++++++++++++++---------
 testsuite/tests/primops/should_compile/T16293a.hs | 19 ++++++++++++++++++
 testsuite/tests/primops/should_compile/all.T      |  1 +
 testsuite/tests/th/T16293b.hs                     | 13 ++++++++++++
 testsuite/tests/th/all.T                          |  1 +
 8 files changed, 64 insertions(+), 19 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 012257c15f584069500af2953ab70856f9a1470e


More information about the ghc-commits mailing list