#3371: Spurious "Defined but not used" when using record wildcards
--------------------------------------------+-------------------------------
    Reporter:  Baughn                       |        Owner:                  
        Type:  bug                          |       Status:  closed          
    Priority:  normal                       |    Milestone:                  
   Component:  Compiler                     |      Version:  6.10.3          
    Severity:  minor                        |   Resolution:  fixed           
    Keywords:                               |   Difficulty:  Unknown         
    Testcase:  rename/should_compile/T3371  |           Os:  Unknown/Multiple
Architecture:  Unknown/Multiple             |  
--------------------------------------------+-------------------------------
Changes (by simonpj):

  * testcase:  => rename/should_compile/T3371
  * difficulty:  => Unknown
  * status:  new => closed
  * resolution:  => fixed

Comment:

 Good point. I fixed this, and some related stuff concerning named fields,
 with this patch:
 {{{
 Thu Aug 20 13:34:43 BST 2009  [email protected]
   * Improvements to record puns, wildcards

   * Make C { A.a } work with punning, expanding to C { A.a = a }

   * Make it so that, with -fwarn-unused-matches,
           f (C {..}) = x
     does not complain about the bindings introduced by the "..".

   * Make -XRecordWildCards implies -XDisambiguateRecordFields.

   * Overall refactoring of RnPat, which had become very crufty.
     In particular, there is now a monad, CpsRn, private to RnPat,
     which deals with the cps-style plumbing.  This is why so many
     lines of RnPat have changed.

   * Refactor the treatment of renaming of record fields into two passes
         - rnHsRecFields1, used both for patterns and expressions,
              which expands puns, wild-cards
         - a local renamer in RnPat for fields in patterns
         - a local renamer in RnExpr for fields in construction and update
     This make it all MUCH easier to understand

   * Improve documentation of record puns, wildcards, and disambiguation


     M ./compiler/basicTypes/RdrName.lhs -5 +9
     M ./compiler/main/DynFlags.hs +6
     M ./compiler/parser/RdrHsSyn.lhs -11 +4
     M ./compiler/rename/RnBinds.lhs -6 +7
     M ./compiler/rename/RnEnv.lhs -139 +124
     M ./compiler/rename/RnExpr.lhs -6 +27
     M ./compiler/rename/RnPat.lhs -384 +394
     M ./compiler/rename/RnSource.lhs -5 +4
     M ./compiler/rename/RnTypes.lhs -2 +2
     M ./compiler/typecheck/TcEnv.lhs -2 +2
     M ./compiler/typecheck/TcPat.lhs -1 +1
     M ./docs/users_guide/glasgow_exts.xml -22 +92
 }}}
 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3371#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to