fix misleading error message regarding function arity
authorYuras Shumovich <shumovichy@gmail.com>
Wed, 10 Dec 2014 00:11:44 +0000 (18:11 -0600)
committerAustin Seipp <austin@well-typed.com>
Wed, 10 Dec 2014 01:59:27 +0000 (19:59 -0600)
commit09b7943321f89b945d10f8a914f4c2cbf73dff91
tree49bf70181834fca639a966d6781ad591881c934e
parentfc45f32491313d2a44e72d8d59cdf95b1660189d
fix misleading error message regarding function arity

Summary:
The error reports something like:

  The function ‘f’ is applied to three arguments,
  but its type ‘Int -> Float -> Char -> Bool’ has only three

The original type was "Monad m => Int -> Float -> m Bool", but
"m" was unified with "-> Char".

Now it looks better:

  The function ‘f’ is applied to three arguments,
  its type is ‘Int -> Float -> m0 Bool’,
  it is specialized to ‘Int -> Float -> Char -> Bool’

Test Plan: T9605

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: carter, thomie

Differential Revision: https://phabricator.haskell.org/D556

GHC Trac Issues: #9605
compiler/typecheck/TcUnify.hs
testsuite/tests/typecheck/should_fail/T9605.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T9605.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T