#1972: Shadowed binding warning message lacks essential information
-----------------------------+----------------------------------------------
    Reporter:  NeilMitchell  |       Owner:         
        Type:  bug           |      Status:  new    
    Priority:  normal        |   Milestone:         
   Component:  Compiler      |     Version:  6.8.1  
    Severity:  normal        |    Keywords:         
  Difficulty:  Unknown       |    Testcase:         
Architecture:  Unknown       |          Os:  Unknown
-----------------------------+----------------------------------------------
 {{{
 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"

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1972>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to