[GHC] #16013: :kind! accepts unsaturated type aliases

GHC ghc-devs at haskell.org
Wed Jan 16 05:52:08 UTC 2019


#16013: :kind! accepts unsaturated type aliases
-------------------------------------+-------------------------------------
        Reporter:  dmwit             |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:  fixed             |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  ghci/should_fail/T16013
      Blocked By:                    |             Blocking:
 Related Tickets:  #13962            |  Differential Rev(s):  Phab:D5471,
       Wiki Page:                    |  https://gitlab.haskell.org/ghc/ghc/merge_requests/90
-------------------------------------+-------------------------------------

Comment (by Ryan Scott <ryan.gl.scott@…>):

 In [changeset:"6b70cf611e5ddc475edaa54b893d20990699ddb8/ghc" 6b70cf6/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="6b70cf611e5ddc475edaa54b893d20990699ddb8"
 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
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16013#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list