[GHC] #10516: PolyKinds results in incorrect reporting of type synonym parameter count

GHC ghc-devs at haskell.org
Sat Jun 13 15:44:26 UTC 2015


#10516: PolyKinds results in incorrect reporting of type synonym parameter count
-------------------------------------+-------------------------------------
              Reporter:              |             Owner:
  benjamin.hodgson                   |            Status:  new
                  Type:  bug         |         Milestone:
              Priority:  normal      |           Version:  7.8.3
             Component:  Compiler    |  Operating System:  MacOS X
              Keywords:              |   Type of failure:  None/Unknown
          Architecture:  x86_64      |        Blocked By:
  (amd64)                            |   Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 The following program is invalid because the declaration of `f` doesn't
 fully apply `App` to all of its arguments.

 {{{#!hs
 {-# LANGUAGE PolyKinds #-}

 type App f a = f a

 newtype X f a = X (f a)

 f :: f a -> X (App f) a
 f = X
 }}}

 However, with the `PolyKinds` extension, the error reporting is quite
 weird:

 {{{
 Type synonym ‘App’ should have 4 arguments, but has been given 3
 In the type signature for ‘f’: f :: f a -> X (App f) a
 }}}

 `App` has ''two'' arguments, and I gave it ''one''! I'm guessing that
 `PolyKinds` makes GHC supply some implicit parameters during expansion of
 type synonyms, and that's what gets reported in the error message. The
 behaviour is correct without `PolyKinds`.

 I've tested this on GHC 7.8.3 (the Haskell Platform version).

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


More information about the ghc-tickets mailing list