warning message could be more helpful
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?
Trac metadata
Trac field | Value |
---|---|
Version | 6.6.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown |
Architecture | Unknown |