Opened 6 years ago

Closed 6 years ago

Last modified 6 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: Difficulty: Unknown
Test Case: rn064 Blocked By:
Blocking: Related Tickets:

Description

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).

Change History (5)

comment:1 Changed 6 years ago by simonpj

  • Owner set to simonpj

I'm fixing this

comment:2 Changed 6 years ago by simonpj

  • Owner changed from simonpj to igloo
  • Type changed from bug to merge

Fixed by

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

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

Simon

comment:3 Changed 6 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

Test now passes correctly.

comment:4 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:5 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.