Ticket #1972 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

Shadowed binding warning message lacks essential information

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

Description

1: {-# OPTIONS_GHC -Wall #-}
2: 
3: module Temp where
4: 
5: data Data = Data {name :: String}
6: 
7: h :: a -> a
8: h name = name

Temp.hs:8:2:
    Warning: This binding for `name' shadows an existing binding
             In the definition of `h'

The problem is that this warning talks only about h, and the location of h (line 8). It doesn't mention that name is also a record selector, or where its defined. My particular instance of this bug involved the data declaration being in a separate module, in code contributed by someone else that I hadn't written.

Suggestion: mention one of "its a record field name", "its from Data", "its defined on line x, in file y"

Change History

Changed 5 years ago by simonpj

  • status changed from new to closed
  • testcase set to T1972
  • resolution set to fixed

Good point. I'm validating a fix, and adding a test case.

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.