[GHC] #2137: Location of shadowed binding is wrong in warning

GHC trac at galois.com
Tue Mar 4 20:55:48 EST 2008


#2137: Location of shadowed binding is wrong in warning
-------------------------+--------------------------------------------------
    Reporter:  igloo     |       Owner:             
        Type:  bug       |      Status:  new        
    Priority:  normal    |   Milestone:  6.10 branch
   Component:  Compiler  |     Version:  6.9        
    Severity:  normal    |    Keywords:             
  Difficulty:  Unknown   |    Testcase:  rn064      
Architecture:  Unknown   |          Os:  Unknown    
-------------------------+--------------------------------------------------
 If we have this module:
 {{{
 module Q where

 z :: a
 z = r
     where
         _a = 'a'
         _f r = r
         _b = 'b'
         r = undefined
         _c = 'c'
 }}}
 then the location of the shadowed `r` is wrong (it's the same as the
 location of the one doing the shadowing):
 {{{
 $ ghc -fforce-recomp -Wall -c q.hs
 q.hs:8:11:
     Warning: This binding for `r' shadows the existing binding
                bound at q.hs:8:11
              In the definition of `_f'
 }}}

 6.8 is fine (it doesn't try to give the location).

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


More information about the Glasgow-haskell-bugs mailing list