Ticket #3476 (closed bug: fixed)
Compiler warning about non-exhaustive pattern match with GADT and type-signature
Description
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.
Change History
Note: See
TracTickets for help on using
tickets.
