[GHC] #281: Wrong overlapped/missing pattern warnings
GHC
trac at galois.com
Mon Aug 7 11:51:10 EDT 2006
#281: Wrong overlapped/missing pattern warnings
-----------------------+----------------------------------------------------
Reporter: nobody | Owner: nobody
Type: bug | Status: assigned
Priority: lowest | Milestone:
Component: Compiler | Version: 6.2.2
Severity: normal | Resolution: None
Keywords: | Os: Unknown
Difficulty: Unknown | Architecture: Unknown
-----------------------+----------------------------------------------------
Changes (by simonmar):
* architecture: => Unknown
* difficulty: => Unknown
* component: Compiler (Parser) => Compiler
* os: => Unknown
Old description:
> {{{
> compiling:
>
> module Overlap where
>
> f (n+1) = 2
> f 0 = 1
>
> emits wrongly:
>
> Warning: Pattern match(es) are overlapped
> In the definition of `f': f 0 = ...
>
> The Patterns are disjoint, aren't they? At least "f 0"
> yields "1" when evaluated and negative inputs for f are
> rejected. However the warning is not emitted if the two
> equations are given in reversed order.
>
> Christian (maeder at tzi.de)
>
> }}}
New description:
{{{
compiling:
module Overlap where
f (n+1) = 2
f 0 = 1
emits wrongly:
Warning: Pattern match(es) are overlapped
In the definition of `f': f 0 = ...
The Patterns are disjoint, aren't they? At least "f 0"
yields "1" when evaluated and negative inputs for f are
rejected. However the warning is not emitted if the two
equations are given in reversed order.
Christian (maeder at tzi.de)
}}}
Comment:
The problems with irrefutable patterns are now fixed (see also #827).
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/281>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list