Compiler warning about non-exhaustive pattern match with GADT and type-signature
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.
Trac metadata
Trac field | Value |
---|---|
Version | 6.10.4 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Type checker) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |