[GHC] #11028: Refactor ConDecl

GHC ghc-devs at haskell.org
Thu Nov 26 12:58:54 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 simonpj):

 Ah yes.  To rename a record we need to know what data constructor it is
 from; this call in `rnHsTyKi`
 {{{
        ; (flds', fvs) <- rnConDeclFields [] doc flds
 }}}
 should not have the empty list, but rather the result of a lookup, just as
 in `RnSource.rnConDeclDetails`.  (Indeed better to pass the `Name` of the
 data constructor to `rnConDeclFields`.)

 Where to get the `Name` of the `DataCon` from in the case of GADTs.  It
 could be in the `HsDocContext` passed down the type renamer.  Change
 `ConDeclCtx` to take a `Name` instead of `RdrName`s.

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


More information about the ghc-tickets mailing list