Fix constraint handling for lazy patterns
authorsimonpj@microsoft.com <unknown>
Fri, 24 Nov 2006 23:05:48 +0000 (23:05 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 24 Nov 2006 23:05:48 +0000 (23:05 +0000)
commit36d207aa8c9cedbf58e739178971292048bd41d0
tree426e0f813b8796c7eb2a7b7ea475b397478a6f06
parent9d0c072038f79d66cd1fc47d9cc7c16fb10d5219
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.
compiler/hsSyn/HsUtils.lhs
compiler/typecheck/TcPat.lhs