Skip to content

Shadowed binding warning message lacks essential information

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"

Trac metadata
Trac field Value
Version 6.8.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information