[project @ 2002-11-07 11:42:48 by simonpj]
------------------
Fix an obscure bug in implicit parameters,
interacting with lazy pattern matching
------------------
MERGE TO STABLE BRANCH
The problem was this:
data UniqueSupply = US Integer
newUnique :: (?uniqueSupply :: UniqueSupply) => Integer
newUnique = r
where US r = ?uniqueSupply
The lazy pattern match in the where clause killed GHC 5.04 because the
SourceType {?uniqueSupply::UniqueSupply} of the RHS of the 'where' didn't
look like a UniqueSupply.
The fix is simple: in DsUtils.mkSelectorBinds, use the pattern, not
the rhs, to get the type reqd. More efficient too.
Test is typecheck/should_compile/tc164.hs