[commit: ghc] wip/T15971, wip/T16150, wip/alp/hadrian-docs-crosslinking, wip/misc-testsuite: Be pickier about unsaturated synonyms in :kind (6b70cf6)

git at git.haskell.org git at git.haskell.org
Wed Jan 9 21:36:10 UTC 2019


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

On branches: wip/T15971,wip/T16150,wip/alp/hadrian-docs-crosslinking,wip/misc-testsuite
Link       : http://ghc.haskell.org/trac/ghc/changeset/6b70cf611e5ddc475edaa54b893d20990699ddb8/ghc

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

commit 6b70cf611e5ddc475edaa54b893d20990699ddb8
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Tue Jan 8 07:37:18 2019 -0500

    Be pickier about unsaturated synonyms in :kind
    
    Summary:
    We currently permit any and all uses of unsaturated type
    synonyms and type families in GHCi's `:kind` command, which allows
    strange interactions like this one:
    
    ```
    > :set -XTypeFamilies -XPolyKinds
    > type family Id (a :: k)
    > type instance Id a = a
    > type Foo x = Maybe
    > :kind! Id Foo
    ```
    
    This is probably a stretch too far, so this patch moves to disallow
    unsaturated synonyms that aren't at the top level (we still want to
    allow `:kind Id`, for instance). We do this by augmenting `GhciCtxt`
    with an additional `Bool` field to indicate if we are at the
    outermost level of the type being passed to `:kind` or not. See
    `Note [Unsaturated type synonyms in GHCi]` in `TcValidity` for the
    full story.
    
    Test Plan: make test TEST=T16013
    
    Reviewers: goldfire, bgamari
    
    Reviewed By: goldfire
    
    Subscribers: simonpj, goldfire, rwbarton, carter
    
    GHC Trac Issues: #16013
    
    Differential Revision: https://phabricator.haskell.org/D5471


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

6b70cf611e5ddc475edaa54b893d20990699ddb8
 compiler/typecheck/TcHsType.hs                 |  2 +-
 compiler/typecheck/TcRnDriver.hs               |  2 +-
 compiler/typecheck/TcType.hs                   |  8 +++-
 compiler/typecheck/TcValidity.hs               | 61 +++++++++++++++++++++++---
 testsuite/tests/ghci/should_fail/T16013.script |  5 +++
 testsuite/tests/ghci/should_fail/T16013.stderr |  3 ++
 testsuite/tests/ghci/should_fail/all.T         |  1 +
 7 files changed, 71 insertions(+), 11 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 6b70cf611e5ddc475edaa54b893d20990699ddb8


More information about the ghc-commits mailing list