[GHC] #3476: Compiler warning about non-exhaustive pattern match
with GADT and type-signature
GHC
trac at galois.com
Sun Aug 30 05:31:03 EDT 2009
#3476: Compiler warning about non-exhaustive pattern match with GADT and type-
signature
---------------------------+------------------------------------------------
Reporter: Ashley Yakeley | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler (Type checker)
Version: 6.10.4 | Severity: normal
Keywords: | Testcase:
Os: Linux | Architecture: x86_64 (amd64)
---------------------------+------------------------------------------------
This program:
{{{
{-# OPTIONS -Wall #-}
{-# LANGUAGE GADTs #-}
module Bug where
data T n where
BoolT :: T Bool
IntT :: T Int
f :: T Bool -> Int
f BoolT = 3
}}}
...gives this warning
{{{
$ ghc -c Bug.hs
Bug.hs:10:4:
Warning: Pattern match(es) are non-exhaustive
In the definition of `f': Patterns not matched: IntT
}}}
The pattern match is, in fact, exhaustive, given the type signature.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3476>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list