[GHC] #9264: Scoped kind variables do not work with default associated types
#9264: Scoped kind variables do not work with default associated types ------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- I have {{{ {-# LANGUAGE PolyKinds, TypeFamilies, ScopedTypeVariables #-} module Bug where class C (a :: k) where type F (a :: k) type F (a :: k) = Int }}} Compiling gives me {{{ Bug.hs:7:11: The signature specified kind ‘k1’, but ‘a’ has kind ‘k2’ In the type ‘(a :: k)’ In the type instance declaration for ‘F’ In the class declaration for ‘C’ }}} The error is on the line declaring the default associated type for `F`. This happens in both 7.8.2 and HEAD. Having !ScopedTypeVariables causes no change, but I put it in the example to emphasize that adding !ScopedTypeVariables is not the solution. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9264> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9264: Scoped kind variables do not work with default associated types -------------------------------------+------------------------------------ Reporter: goldfire | Owner: simonpj Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by simonpj): * owner: => simonpj Comment: I have a patch that fixes this, among other things. But it'll have to wait till I get back from holiday on 14 July. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9264#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9264: Scoped kind variables do not work with default associated types -------------------------------------+------------------------------------ Reporter: goldfire | Owner: simonpj Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"9b8ba62991ae22420a0c4486127a3b22ee7f22bd/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="9b8ba62991ae22420a0c4486127a3b22ee7f22bd" Entirely re-jig the handling of default type-family instances (fixes Trac #9063) In looking at Trac #9063 I decided to re-design the default instances for associated type synonyms. Previously it was all jolly complicated, to support generality that no one wanted, and was arguably undesirable. Specifically * The default instance for an associated type can have only type variables on the LHS. (Not type patterns.) * There can be at most one default instances declaration for each associated type. To achieve this I had to do a surprisingly large amount of refactoring of HsSyn, specifically to parameterise HsDecls.TyFamEqn over the type of the LHS patterns. That change in HsDecls has a (trivial) knock-on effect in Haddock, so this commit does a submodule update too. The net result is good though. The code is simpler; the language specification is simpler. Happy days. Trac #9263 and #9264 are thereby fixed as well. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9264#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9264: Scoped kind variables do not work with default associated types -------------------------------------+------------------------------------- Reporter: goldfire | Owner: simonpj Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Differential Revisions: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: polykinds/T9264 Difficulty: Unknown | Blocking: Blocked By: | Related Tickets: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => polykinds/T9264 * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9264#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC