Skip to content

Incorrect warning: Pattern match(es) are overlapped

The following program

main = print $ f ab

a = "foo"
ab = "bar"

f :: String -> Int
f a = 0
f ab = 1

produces

Warning: Pattern match(es) are overlapped
             In the definition of `f': f ab = ...

but the patterns don't overlap, i.e., if a matches, ab does not match, and viceversa.

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