[GHC] #11028: Refactor ConDecl

GHC ghc-devs at haskell.org
Thu Nov 26 08:52:13 UTC 2015


#11028: Refactor ConDecl
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  alanz
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by alanz):

 The current error is

 {{{
 compiler/cmm/CmmNode.hs:88:20: error:
     Record syntax is illegal here:
       {cml_pred :: CmmExpr,
        cml_true, cml_false :: {-# UNPACK #-} !Label,
        cml_likely :: Maybe Bool}

 }}}

 which is a record style GADT constructor declaration.


 I do not understand how

 {{{#!hs
 rnHsTyKi _ doc ty@(HsRecTy flds)
   = do { addErr (hang (ptext (sLit "Record syntax is illegal here:"))
                     2 (ppr ty))
        ; (flds', fvs) <- rnConDeclFields [] doc flds
        ; return (HsRecTy flds', fvs) }
 }}}

 works.  The error is always added, I do not see `discardErrors` in
 `rnConDeclFields`. What am I missing?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11028#comment:26>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list