|
Subject: patch applied (ghc): Fix constraint handling for lazy patterns Newsgroups: gmane.comp.lang.haskell.cvs.ghc Date: 2006-11-24 23:15:17 GMT (1 year, 51 weeks, 4 days, 22 hours and 20 minutes ago)
Fri Nov 24 15:05:48 PST 2006 simonpj <at> microsoft.com
* 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
|
|
|