#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 ([EMAIL PROTECTED])
>
> }}}

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 ([EMAIL PROTECTED])

 }}}

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
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to