[GHC] #14331: Overzealous free-floating kind check causes deriving clause to be rejected

GHC ghc-devs at haskell.org
Sat Oct 7 02:47:36 UTC 2017


#14331: Overzealous free-floating kind check causes deriving clause to be rejected
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.2.1
  checker)                           |
      Resolution:                    |             Keywords:  deriving
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 I spoke too soon about that second program (with data families) working.
 It turns out that it's rejected on GHC HEAD:

 {{{
 GHCi, version 8.3.20171004: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 [1 of 1] Compiling Bug              ( Bug.hs, interpreted )

 Bug.hs:10:1: error:
     • Kind variable ‘k’ is implicitly bound in data family
       ‘D1’, but does not appear as the kind of any
       of its type variables. Perhaps you meant
       to bind it (with TypeInType) explicitly somewhere?
     • In the data instance declaration for ‘D1’
    |
 10 | data instance D1 = D1 deriving (C (a :: k))
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 Bug.hs:16:3: error:
     • Kind variable ‘k’ is implicitly bound in data family
       ‘D2’, but does not appear as the kind of any
       of its type variables. Perhaps you meant
       to bind it (with TypeInType) explicitly somewhere?
     • In the data instance declaration for ‘D2’
       In the instance declaration for ‘E’
    |
 16 |   data D2 = D2 deriving (C (a :: k))
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 }}}

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


More information about the ghc-tickets mailing list