Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2137 closed merge (fixed)

Location of shadowed binding is wrong in warning

Reported by: igloo Owned by: igloo
Priority: normal Milestone: 6.10 branch
Component: Compiler Version: 6.9
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: rn064
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


If we have this module:

module Q where

z :: a
z = r
        _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
    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).

Change History (5)

comment:1 Changed 9 years ago by simonpj

Owner: set to simonpj

I'm fixing this

comment:2 Changed 9 years ago by simonpj

Owner: changed from simonpj to igloo
Type: bugmerge

Fixed by

Wed Apr  2 08:34:10 PDT 2008
  * Fix Trac #2137: report correct location for shadowed binding

Ian: can you change the test to 'should pass'?


comment:3 Changed 9 years ago by igloo

Resolution: fixed
Status: newclosed

Test now passes correctly.

comment:4 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:5 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.