[project @ 2000-06-09 15:53:12 by simonpj]
authorsimonpj <unknown>
Fri, 9 Jun 2000 15:53:12 +0000 (15:53 +0000)
committersimonpj <unknown>
Fri, 9 Jun 2000 15:53:12 +0000 (15:53 +0000)
commitb610eca3e4405e185bab53204cf2829893ada268
tree0b27c3260e52c9cc738718d5c8bd45e67c27a4e3
parent45a3e562564889cf52d65dbe2b98bb426aa305fe
[project @ 2000-06-09 15:53:12 by simonpj]
GHC gets upset if you have types like

Eq a => a->a

where 'a' is *not* universally quantified.
By "upset" I mean that the typechecker generates
rather bogus code, that subsequently kills Lint.

Such types used to be rejected in the renamer,
but Jeff removed that in favour of an ambiguity
check in TcMonoType.  I remember agreeing to move
the renamer check to the type checker, and Jeff did this,
but the check in TcMonoType was only checking for
*ambiguity*, which isn't quite the same.

I've restored the missing check and commented it
better in TcMonoType.

Jeff: if this isn't right for you, let's dicuss.

Incidentally, I also generalise the ambiguity check
to detect
forall a. ?x::a => Int
which is ambiguous.

I did a few formatting changes too.
ghc/compiler/hsSyn/HsMatches.lhs
ghc/compiler/rename/RnSource.lhs
ghc/compiler/typecheck/TcMonoType.lhs
ghc/compiler/types/PprType.lhs