
#14348: Poly-kinded definitions silently introduce extra type arguments captured by TypeApplications -------------------------------------+------------------------------------- Reporter: gallais | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 (Type checker) | Keywords: | 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: -------------------------------------+------------------------------------- The first type argument of a poly-kinded definition is not the one explicitly quantified over in the definition but rather the implicitly inserted kind. This leads to the puzzling error message "Expected a type, but âaâ has kind âkâ" when ghc actually expected a kind. {{{#!haskell {-# LANGUAGE GADTs, PolyKinds, ScopedTypeVariables, TypeApplications #-} data EQ :: k -> k -> * where Refl :: EQ a a data Wrap (a :: k) = Wrap (EQ a a) wrap :: forall (a :: k). Wrap a wrap = Wrap @a Refl -- fails -- wrap = Wrap @k @a Refl -- works }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14348 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler