[GHC] #9896: panic: wrongKindOfFamily

GHC ghc-devs at haskell.org
Thu Dec 18 08:19:34 UTC 2014


#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


More information about the ghc-tickets mailing list