[GHC] #29: Check for exhaustive patterns is broken

GHC trac at galois.com
Mon Oct 2 20:36:34 EDT 2006


#29: Check for exhaustive patterns is broken
-----------------------+----------------------------------------------------
  Reporter:  nobody    |          Owner:  nobody  
      Type:  bug       |         Status:  assigned
  Priority:  lowest    |      Milestone:  _|_     
 Component:  Compiler  |        Version:  5.02    
  Severity:  normal    |     Resolution:  None    
  Keywords:            |             Os:  Unknown 
Difficulty:  Unknown   |   Architecture:  Unknown 
-----------------------+----------------------------------------------------
Changes (by igloo):

  * architecture:  => Unknown
  * difficulty:  => Unknown
  * milestone:  => _|_
  * os:  => Unknown

Old description:

> {{{
> When some of the patterns in a function definition or
> case expression contain guards, the compiler gives
> false warnings about non-exhaustive pattern matches.  A
> pity, because this kind of warning is very useful
> indeed!
>
> For example, I get
>  >ghc --make -Wall See.hs
>  ghc-5.02.1: chasing modules from: See.hs
>  Compiling See              ( See.hs, ./See.o )
>
>  See.hs:17: Warning: Pattern match(es) are
> non-exhaustive
>      In the definition of `insert':
>         Patterns not matched: _ _ (TREE _ _ _ _)
>
>  See.hs:41: Warning: Pattern match(es) are
> non-exhaustive
>     In a case alternative EMPTY: Patterns not matched:
> TREE _ _ _ _
>
> for the attached file.
>
> [I am not sure filling in the e-mail address box had
> any effect on the last two complaints I submitted, so I
> repeat my address here:
> feliks at crt.se]
> }}}

New description:

 {{{
 When some of the patterns in a function definition or
 case expression contain guards, the compiler gives
 false warnings about non-exhaustive pattern matches.  A
 pity, because this kind of warning is very useful
 indeed!

 For example, I get
  >ghc --make -Wall See.hs
  ghc-5.02.1: chasing modules from: See.hs
  Compiling See              ( See.hs, ./See.o )

  See.hs:17: Warning: Pattern match(es) are
 non-exhaustive
      In the definition of `insert':
         Patterns not matched: _ _ (TREE _ _ _ _)

  See.hs:41: Warning: Pattern match(es) are
 non-exhaustive
     In a case alternative EMPTY: Patterns not matched:
 TREE _ _ _ _

 for the attached file.

 [I am not sure filling in the e-mail address box had
 any effect on the last two complaints I submitted, so I
 repeat my address here:
 feliks at crt.se]
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/29>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list