[GHC] #9896: panic: wrongKindOfFamily

#9896: panic: wrongKindOfFamily -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- The following code panics with GHC HEAD: {{{#!hs {-# LANGUAGE TypeFamilies #-} class Test a where type TestT a :: * instance Test Bool where newtype TestT Bool = Int }}} {{{ $ ghc Panic2.hs [1 of 1] Compiling Main ( Panic2.hs, Panic2.o ) Panic2.hs:7:3:ghc.exe: panic! (the 'impossible' happened) (GHC version 7.9.20141217 for i386-unknown-mingw32): wrongKindOfFamily TestT Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9896 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9896: panic: wrongKindOfFamily -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by jstolarek): A simple fix for this can go into the `Parser.y` by changing second production in `at_decl_inst` from: {{{ -- data/newtype instance declaration | data_or_newtype capi_ctype tycl_hdr constrs deriving {% amms (mkDataFamInst (comb4 $1 $3 $4 $5) (snd $ unLoc $1) $2 $3 Nothing (reverse (snd $ unLoc $4)) (unLoc $5)) ((fst $ unLoc $1):(fst $ unLoc $4)) } }}} to {{{ -- data/newtype instance declaration | 'data' capi_ctype tycl_hdr constrs deriving {% amms (mkDataFamInst (comb4 $1 $3 $4 $5) DataType $2 $3 Nothing (reverse (snd $ unLoc $4)) (unLoc $5)) ((mj AnnData $1):(fst $ unLoc $4)) } }}} Then your definition would be rejected as a parse error. However, on my branch this change drastically increases the number of reduce/reduce conflicts so perhaps a different solution would be better. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9896#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9896: panic: wrongKindOfFamily
-------------------------------------+-------------------------------------
Reporter: luite | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.9
Resolution: | Keywords:
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Unknown
Type of failure: | Blocked By:
None/Unknown | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#9896: panic: wrongKindOfFamily -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: fixed | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: indexed- | types/should_fail/T9896 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => indexed-types/should_fail/T9896 * resolution: => fixed Comment: Thanks for reporting this; fixed. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9896#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC