#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_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs