patch applied (ghc): Take account of GADTs when reporting
Simon Peyton Jones
simonpj at microsoft.com
Wed Jul 22 02:00:29 EDT 2009
Tue Jul 21 22:09:33 PDT 2009 simonpj at microsoft.com
* Take account of GADTs when reporting patterm-match overlap
When matching against a GADT, some of the constructors may be impossible.
data T a where
T1 :: T Int
T2 :: T Bool
T3 :: T a
f :: T Int -> Int
f T1 = 3
f T3 = 4
Here, does not have any missing cases, despite omittting T2, because
T2 :: T Bool.
This patch teaches the overlap checker about GADTs, which happily
turned out to be rather easy even though the overlap checker needs
a serious rewrite.
M ./compiler/deSugar/Check.lhs -6 +9
M ./compiler/typecheck/TcTyClsDecls.lhs -1 +8
View patch online:
More information about the Cvs-ghc