[project @ 2002-11-07 11:42:48 by simonpj]
authorsimonpj <unknown>
Thu, 7 Nov 2002 11:42:48 +0000 (11:42 +0000)
committersimonpj <unknown>
Thu, 7 Nov 2002 11:42:48 +0000 (11:42 +0000)
commit06fa575f4b4c51ab48fc4e7f5bd512b8c30325f9
tree3688967685b38e5310506eefcdc666e7d87fe8a2
parente26dd9a959b7b7810c2e2089940422092a95f2e3
[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
ghc/compiler/deSugar/DsUtils.lhs