Report arity errors correctly despite kinds
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 18 Jun 2015 07:54:11 +0000 (08:54 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 18 Jun 2015 07:54:11 +0000 (08:54 +0100)
commit5879d5aab929e9959d48e03dad456b824160b3bf
treed9c9d012dc9a06f2e0c77fc487ff5a58a8130df1
parent023a0ba938b69bbb89cb2ce48a07459b07783391
Report arity errors correctly despite kinds

Trac #10516 pointed out that when reporting arity errors
(like "T needs 2 arguments but has been given 1"), we should
not count kind arguments, since they are implicit.  If we
include kind args in the count, we get very confusing error
messages indeed.

I did a little bit of refactoring which make some
error messages wobble around.  But the payload of
this fix is in TcValidity.tyConArityErr
35 files changed:
compiler/typecheck/TcPat.hs
compiler/typecheck/TcTyClsDecls.hs
compiler/typecheck/TcValidity.hs
compiler/types/TyCon.hs
testsuite/tests/gadt/T3163.stderr
testsuite/tests/gadt/gadt11.stderr
testsuite/tests/gadt/gadtSyntaxFail001.stderr
testsuite/tests/gadt/gadtSyntaxFail002.stderr
testsuite/tests/gadt/gadtSyntaxFail003.stderr
testsuite/tests/gadt/records-fail1.stderr
testsuite/tests/ghci/scripts/T9293.stderr
testsuite/tests/ghci/scripts/ghci057.stderr
testsuite/tests/indexed-types/should_fail/BadSock.stderr
testsuite/tests/indexed-types/should_fail/T2157.stderr
testsuite/tests/indexed-types/should_fail/T9433.stderr
testsuite/tests/module/mod60.stderr
testsuite/tests/parser/should_fail/ParserNoBinaryLiterals2.stderr
testsuite/tests/parser/should_fail/ParserNoBinaryLiterals3.stderr
testsuite/tests/polykinds/T10516.hs [new file with mode: 0644]
testsuite/tests/polykinds/T10516.stderr [new file with mode: 0644]
testsuite/tests/polykinds/T9222.stderr
testsuite/tests/polykinds/all.T
testsuite/tests/typecheck/should_compile/T7050.stderr
testsuite/tests/typecheck/should_compile/T7562.stderr
testsuite/tests/typecheck/should_fail/T3966.stderr
testsuite/tests/typecheck/should_fail/T7175.stderr
testsuite/tests/typecheck/should_fail/tcfail100.stderr
testsuite/tests/typecheck/should_fail/tcfail101.stderr
testsuite/tests/typecheck/should_fail/tcfail107.stderr
testsuite/tests/typecheck/should_fail/tcfail129.stderr
testsuite/tests/typecheck/should_fail/tcfail140.stderr
testsuite/tests/typecheck/should_fail/tcfail155.stderr
testsuite/tests/typecheck/should_fail/tcfail187.stderr
testsuite/tests/typecheck/should_fail/tcfail195.stderr
testsuite/tests/typecheck/should_fail/tcfail209.stderr