patch applied (ghc): Fix constraint handling for lazy patterns
Simon Peyton Jones <[email protected]>
| Newsgroups | gmane.comp.lang.haskell.cvs.all |
|---|---|
| Message-ID | <20061124231517.GA21494__9471.20087589628$1164410137$gmane$org@cvs.haskell.org> |
Fri Nov 24 15:05:48 PST 2006 [email protected] * Fix constraint handling for lazy patterns Lazy patterns are quite tricky! Consider f ~(C x) = 3 Can the Num constraint from the 3 be discharged by a Num dictionary bound by the pattern? Definitely not! See Note [Hopping the LIE in lazy patterns] in TcPat The type checker wasn't ensuring this, and that was causing all manner of strange things to happen. It actually manifested as a strictness bug reported by Sven Panne. I've added his test case as tcrun040. M ./compiler/hsSyn/HsUtils.lhs -6 +13 M ./compiler/typecheck/TcPat.lhs -4 +19