Re: [GHC] #1347: warning message could be more helpful
#1347: warning message could be more helpful -+-- Reporter: guest |Owner: Type: bug | Status: closed Priority: normal|Milestone: Component: Compiler | Version: 6.6.1 Severity: normal| Resolution: invalid Keywords:| Difficulty: Unknown Os: Unknown | Testcase: Architecture: Unknown | -+-- Changes (by igloo): * resolution: = invalid * status: new = closed Comment: If you compile with `-Wall` (which I recommend!) (or `-fwarn-name- shadowing`) then, as well as the above warning, you will also get {{{ Warning: This binding for `wM_DESTROY' shadows an existing binding In a case alternative }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1347 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
[GHC] #1347: warning message could be more helpful
#1347: warning message could be more helpful ---+ Reporter: guest | Owner: Type: bug | Status: new Priority: normal| Milestone: Component: Compiler |Version: 6.6.1 Severity: normal| Keywords: Difficulty: Unknown | Os: Unknown Testcase:| Architecture: Unknown ---+ Code was: {{{ case msg of wM_DESTROY - do sendMessage hwnd wM_QUIT 1 0 return 0 otherwise - defWindowProc (Just hwnd) msg wparam lparam }}} warning message was: {{{ Warning: Pattern match(es) are overlapped In a case alternative: otherwise - ... }}} It took me a long time to realize that wM_DESTROY was being interpreted as a new variable name shadowing the imported constant. The compiler realizes that something is probably wrong (overlapped patterns). It could further check and see that wM_DESTROY is shadowing an already existing binding and give a messages like this: {{{ Warning: Pattern match(es) are overlapped In a case alternative: otherwise - ... Hint: Are you sure you want to shadow the existing binding for wM_DESTROY? }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1347 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs