[GHC] #6118: Kind variable falls out of scope in instance declaration

GHC ghc-devs at haskell.org
Mon May 9 20:04:16 UTC 2016


#6118: Kind variable falls out of scope in instance declaration
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.5
      Resolution:  fixed             |             Keywords:  PolyKinds
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  polykinds/T6118
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 8.1.20160503:

 {{{#!hs
 -- twgv.hs:32:3-43: error: …
 --     The RHS of an associated type declaration mentions ‘k’
 --       All such variables must be bound on the LHS
 -- Compilation failed.

 instance SingE (a :: Maybe k) where
   type Demote a = Maybe (Demote (Any :: k))
 }}}

 Still fails, kind annotation needed:

 {{{#!hs
 instance SingE (a :: Maybe k) where
   type Demote (a ::Maybe k) = Maybe (Demote (Any :: k))
 }}}

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


More information about the ghc-tickets mailing list