Ticket #2293 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

Multiple declaration error shown multiple times

Reported by: NeilMitchell Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: rn_dup Blocked By:
Blocking: Related Tickets:

Description

Given the file:

foo = 1
a = ()
foo = 1
b = ()
foo = 1

You get the error message:

Uniplate.hs:3:0:
    Multiple declarations of `Main.foo'
    Declared at: Uniplate.hs:1:0
                 Uniplate.hs:3:0

Uniplate.hs:5:0:
    Multiple declarations of `Main.foo'
    Declared at: Uniplate.hs:1:0
                 Uniplate.hs:5:0

Instead of the much simpler:

Uniplate.hs:5:0:
    Multiple declarations of `Main.foo'
    Declared at: Uniplate.hs:1:0
                 Uniplate.hs:3:0
                 Uniplate.hs:5:0

This also happens with multiple class definitions, but if you give multiple type signatures then the error message is properly merged.

Change History

Changed 5 years ago by simonpj

  • status changed from new to closed
  • difficulty set to Unknown
  • resolution set to fixed
  • testcase set to rn_dup

Good suggestion. I couldn't resist fixing this. I think we'll leave the fix in the HEAD only though.

Tue May 20 15:30:06 BST 2008  simonpj@microsoft.com
  * Fix Trac #2293: improve error reporting for duplicate declarations

Simon

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

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