[commit: ghc] master: Fix #14869 by being more mindful of Type vs. Constraint (49ac3f0)

git at git.haskell.org git at git.haskell.org
Wed Mar 21 13:18:22 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/49ac3f0f2a13f66fea31a258fa98b0de39bfbf10/ghc

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

commit 49ac3f0f2a13f66fea31a258fa98b0de39bfbf10
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Wed Mar 21 08:59:28 2018 -0400

    Fix #14869 by being more mindful of Type vs. Constraint
    
    Summary:
    Before, we were using `isLiftedTypeKind` in `reifyType`
    before checking if a type was `Constraint`. But as it turns out,
    `isLiftedTypeKind` treats `Constraint` the same as `Type`, so every
    occurrence of `Constraint` would be reified as `Type`! To make things
    worse, the documentation for `isLiftedTypeKind` stated that it
    treats `Constraint` //differently// from `Type`, which simply isn't
    true.
    
    This revises the documentation for `isLiftedTypeKind` to reflect
    reality, and defers the `isLiftedTypeKind` check in `reifyType` so
    that it does not accidentally swallow `Constraint`.
    
    Test Plan: make test TEST=T14869
    
    Reviewers: goldfire, bgamari
    
    Reviewed By: goldfire
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #14869
    
    Differential Revision: https://phabricator.haskell.org/D4474


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

49ac3f0f2a13f66fea31a258fa98b0de39bfbf10
 compiler/typecheck/TcSplice.hs   |  7 ++++--
 compiler/types/Kind.hs           | 31 +++++++++++++--------------
 compiler/types/TyCoRep.hs        | 46 ++++++++++++++++++++++++++++++----------
 testsuite/tests/th/T14869.hs     | 25 ++++++++++++++++++++++
 testsuite/tests/th/T14869.stderr | 17 +++++++++++++++
 testsuite/tests/th/all.T         |  2 ++
 6 files changed, 99 insertions(+), 29 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 49ac3f0f2a13f66fea31a258fa98b0de39bfbf10


More information about the ghc-commits mailing list