Opened 3 years ago

Closed 3 years ago

#5434 closed bug (fixed)

<no location info> for shadowing warnings in TH-generated code

Reported by: byorgey Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.2.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Difficulty:
Test Case: th/T5434 Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo)

See attached test case, which causes this warning to be printed when THShadowSplice.hs is compiled with -Wall:

<no location info>:
    Warning: This binding for `x' shadows the existing binding
               bound at THShadowSplice.hs:7:3

There ought to be some location info. I have also seen warnings of the form

<no location info>:
    Warning: This binding for `x' shadows the existing binding
               bound at <no location info>

although I have not yet been able to construct a small test case which exhibits this behavior.

Attachments (2)

THShadow.hs (260 bytes) - added by byorgey 3 years ago.
THShadowSplice.hs (108 bytes) - added by byorgey 3 years ago.

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by byorgey

Changed 3 years ago by byorgey

comment:1 Changed 3 years ago by igloo

  • Description modified (diff)

comment:2 Changed 3 years ago by simonpj@…

commit 68bcb1399c8cd17f6db641a68fd4d20fff08c01a

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Fri Sep 2 09:11:24 2011 +0100

    Make Convert.thRdrName give a decent source locations (fixes Trac #5434)
    
    thRdrName is used to construct *binders*, and some of them are
    Exact RdrNames, so we need to give them a decent source location.

 compiler/hsSyn/Convert.lhs |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

comment:3 Changed 3 years ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to th/T5434

Thanks. Fixed and test added.

Note: See TracTickets for help on using tickets.