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

GHC ghc-devs at haskell.org
Tue Jan 8 19:32:28 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
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * status:  patch => closed
 * testcase:   => ghci/should_fail/T16013
 * resolution:   => fixed
 * milestone:   => 8.8.1


Comment:

 Landed in
 [https://gitlab.haskell.org/ghc/ghc/commit/6b70cf611e5ddc475edaa54b893d20990699ddb8
 6b70cf611e5ddc475edaa54b893d20990699ddb8]:

 {{{
 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
 }}}

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


More information about the ghc-tickets mailing list