[GHC] #8105: unhelpful error message PolyKinds + GADTs

#8105: unhelpful error message PolyKinds + GADTs -------------------------+------------------------------------------------- Reporter: wvv | Owner: Type: bug | Status: new Priority: | Milestone: normal | Version: 7.6.3 Component: | Operating System: Unknown/Multiple Compiler | Type of failure: Incorrect warning at Keywords: | compile-time Architecture: | Test Case: Unknown/Multiple | Blocking: Difficulty: | Unknown | Blocked By: | Related Tickets: | -------------------------+------------------------------------------------- For {{{ data Foo (a::k) = Foo a }}} we have next right error: {{{ Kind mis-match Expected kind `OpenKind', but `a' has kind `k' In the type `a' In the definition of data constructor `Foo' In the data declaration for `Foo' }}} but for same GADTs data we have just {{{ data Foo (a::k) where Foo a :: Foo a <interactive>:38:27: parse error on input `a' }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8105 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8105: unhelpful error message PolyKinds + GADTs -------------------------------------------------+------------------------- Reporter: wvv | Owner: Type: bug | Status: Priority: normal | closed Component: Compiler | Milestone: Resolution: invalid | Version: 7.6.3 Operating System: Unknown/Multiple | Keywords: Type of failure: Incorrect warning at | Architecture: compile-time | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by goldfire): * status: new => closed * resolution: => invalid Comment: I would say that GHC's behavior there is correct. The GADT-syntax equivalent of your first example is {{{ data Foo (a::k) where Foo :: a -> Foo a }}} In GHC 7.6.3, I get this sensible error: {{{ Kind mis-match The first argument of `Foo' should have kind `k1', but `a' has kind `*' In the type `Foo a' In the definition of data constructor `Foo' In the data declaration for `Foo' }}} The problem with your code is that GADT syntax requires just the name of the data constructor to the left of the `::`. Anything else there really is a parse error. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8105#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC