[GHC] #7892: GHC accepts multiple conflicting kind signatures in type class declarations

#7892: GHC accepts multiple conflicting kind signatures in type class declarations ----------------------------------------+----------------------------------- Reporter: MartijnVanSteenbergen | Owner: Type: bug | Status: new Priority: normal | Component: Compiler (Type checker) Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: GHC accepts invalid program | Blockedby: Blocking: | Related: ----------------------------------------+----------------------------------- Hi, Consider this suspicious looking program: {{{ {-# LANGUAGE TypeFamilies #-} class C (f :: * -> *) where type F (f :: *) :: * }}} I use the same type argument name `f` but specify different kinds. Now I can never define an instance anymore: {{{ instance C [] where -- Error: Type indexes must match class instance head -- type F () = () -- Error: Expecting one more argument to `[]' -- type F [] = () }}} I think GHC should verify, if the same type argument name is used multiple times in a type class definition, that their kinds match. In that case the type class above would be rejected. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7892 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7892: GHC accepts multiple conflicting kind signatures in type class declarations ----------------------------------------+----------------------------------- Reporter: MartijnVanSteenbergen | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: GHC accepts invalid program Difficulty: Unknown | Testcase: typecheck/should_fail/T7892 Blockedby: | Blocking: Related: | ----------------------------------------+----------------------------------- Changes (by simonpj): * testcase: => typecheck/should_fail/T7892 * difficulty: => Unknown Comment: Quite right. Happily this is already fixed in HEAD. {{{ T7892.hs:5:4: Couldn't match kind ‛*’ against ‛* -> *’ }}} Simon -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7892#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7892: GHC accepts multiple conflicting kind signatures in type class declarations ------------------------------------------+--------------------------------- Reporter: MartijnVanSteenbergen | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: GHC accepts invalid program | Difficulty: Unknown Testcase: typecheck/should_fail/T7892 | Blockedby: Blocking: | Related: ------------------------------------------+--------------------------------- Changes (by simonpj): * status: new => closed * resolution: => fixed -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7892#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7892: GHC accepts multiple conflicting kind signatures in type class declarations ------------------------------------------+--------------------------------- Reporter: MartijnVanSteenbergen | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: GHC accepts invalid program | Difficulty: Unknown Testcase: typecheck/should_fail/T7892 | Blockedby: Blocking: | Related: ------------------------------------------+--------------------------------- Comment(by MartijnVanSteenbergen): Excellent, thank you! -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7892#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC