• Ryan Scott's avatar
    Be pickier about unsaturated synonyms in :kind · 6b70cf61
    Ryan Scott authored
    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
    6b70cf61
Name
Last commit
Last update
..
T11827 Loading commit data...
linking Loading commit data...
prog001 Loading commit data...
prog002 Loading commit data...
prog003 Loading commit data...
prog004 Loading commit data...
prog005 Loading commit data...
prog006 Loading commit data...
prog007 Loading commit data...
prog008 Loading commit data...
prog009 Loading commit data...
prog010 Loading commit data...
prog011 Loading commit data...
prog012 Loading commit data...
prog013 Loading commit data...
prog014 Loading commit data...
prog015 Loading commit data...
prog016 Loading commit data...
prog017 Loading commit data...
scripts Loading commit data...
should_fail Loading commit data...
should_run Loading commit data...
Makefile Loading commit data...
shell.hs Loading commit data...