[GHC] #5728: Warnings from -fwarn-incomplete-record-updates even with all constructors matched

GHC cvs-ghc at haskell.org
Thu Mar 8 15:05:57 CET 2012


#5728: Warnings from -fwarn-incomplete-record-updates even with all constructors
matched
---------------------------------+------------------------------------------
    Reporter:  mjo               |       Owner:                                   
        Type:  bug               |      Status:  new                              
    Priority:  normal            |   Milestone:  _|_                              
   Component:  Compiler          |     Version:  7.4.1                            
    Keywords:  warnings          |          Os:  Unknown/Multiple                 
Architecture:  Unknown/Multiple  |     Failure:  Incorrect warning at compile-time
  Difficulty:  Unknown           |    Testcase:                                   
   Blockedby:                    |    Blocking:                                   
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by simonpj):

 Using record wild-cards you can write (nb untested)
 {{{
 updA :: Int -> Rec -> Rec
 updA i (Rec { .. }) = Rec { a = i, .. }
 updA _ Mt = Mt
 }}}
 which, I suppose, has the merit of making it obvious that you are
 returning a `Rec` constructor.

 Simon

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



More information about the Glasgow-haskell-bugs mailing list