> The program shown below elicits a complaint about pattern overlap for
> doMem1.  I don't expect any complaint.

> doMem1 (NUMOP ADD e1         (CONST i)) = 1
> doMem1 (NUMOP ADD (LREF lab) (CONST i)) = 4
> doMem1 (NUMOP SUB e1         (CONST i)) = 3
> doMem1 (NUMOP SUB (LREF lab) (CONST i)) = 6

I have reformatted your code slightly to make the error more obvious.
For both the ADD and SUB cases, the pattern variable e1 will always
match, and the constructor pattern (LREF lab) will never match because
the former match has already been successful.

An excellent bug-catch from ghc there I think!

Regards,
    Malcolm

_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to