Ticket #1972 (closed bug: fixed)
Shadowed binding warning message lacks essential information
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
Note: See
TracTickets for help on using
tickets.
