[project @ 2005-07-11 09:54:43 by simonpj]
authorsimonpj <unknown>
Mon, 11 Jul 2005 09:54:44 +0000 (09:54 +0000)
committersimonpj <unknown>
Mon, 11 Jul 2005 09:54:44 +0000 (09:54 +0000)
commit9fe510d19e48f1cefdf3591c8669cd74a63867b7
tree900695f6c1198f275d432adc42fbd322f36bcb63
parenta6f3a1f8f6e28289b5986637f47bd08e1381675e
[project @ 2005-07-11 09:54:43 by simonpj]
Improve the error message from unifyFunTys.  Previously we got a really
horrible message from this:
  t = ((\Just x -> x) :: Maybe a -> a) (Just 1)

Try.hs:1:6:
    Couldn't match the rigid variable `a' against `t -> t1'
      Expected type: a
      Inferred type: t -> t1

Now it's much better:

Try.hs:14:6:
    The lambda expression `\ Just x -> ...' has two arguments,
    but its type `Maybe a -> a' has only one
    In the expression: (\ Just x -> x) :: Maybe a -> a

tcfail140 tests some cases
ghc/compiler/hsSyn/HsExpr.lhs
ghc/compiler/typecheck/TcExpr.lhs
ghc/compiler/typecheck/TcMType.lhs
ghc/compiler/typecheck/TcMatches.lhs
ghc/compiler/typecheck/TcUnify.lhs