[project @ 2001-06-25 08:01:16 by simonpj]
authorsimonpj <unknown>
Mon, 25 Jun 2001 08:01:16 +0000 (08:01 +0000)
committersimonpj <unknown>
Mon, 25 Jun 2001 08:01:16 +0000 (08:01 +0000)
commita12bed5371650117aab631ac032fb1b525570c00
treeae35c7a84f3aab0327bfb4e1018503e41b42bddb
parentef934baea32e045d799eb059d5371feb15cf111e
[project @ 2001-06-25 08:01:16 by simonpj]
----------------------------------
Fix a predicate-simplification bug
----------------------------------

Fixes a bug pointed out by Marcin

    data R = R {f :: Int}
    foo:: (?x :: Int) => R -> R
    foo r = r {f = ?x}

    Test.hs:4:
Could not deduce `?x :: Int' from the context ()
arising from use of implicit parameter `?x' at Test.hs:4
In the record update: r {f = ?x}
In the definition of `foo': r {f = ?x}

The predicate simplifier was declining to 'inherit' an
implicit parameter.  This is right for a let-binding, but
wrong for an expression binding.  For example, a simple
expression type signature:

(?x + 1) :: Int

This was rejected because the ?x constraint could not be
floated out -- but that's wrong for expressions.
ghc/compiler/typecheck/TcSimplify.lhs