Fix #13311 by using tcSplitNestedSigmaTys in the right place
authorRyan Scott <ryan.gl.scott@gmail.com>
Mon, 3 Jul 2017 20:54:14 +0000 (16:54 -0400)
committerBen Gamari <ben@smart-cactus.org>
Mon, 3 Jul 2017 22:58:11 +0000 (18:58 -0400)
commitc3a78623cf7bb74c8ca0749f1216e802aa37a721
tree5ab11d296782897063263d491514f517c5a4c66e
parentf9c6d53fe997f1c560cda6f346f4b201711df37c
Fix #13311 by using tcSplitNestedSigmaTys in the right place

Previously, we we only using `tcSplitSigmaTy` when determining if a
function had been applied to too few arguments, so it wouldn't work for
functions with nested `forall`s. Thankfully, this is easily fixed with a
dash of `tcSplitNestedSigmaTys`.

Test Plan: make test TEST=T13311

Reviewers: austin, bgamari, simonpj

Reviewed By: bgamari

Subscribers: goldfire, simonpj, rwbarton, thomie

GHC Trac Issues: #13311

Differential Revision: https://phabricator.haskell.org/D3678
compiler/typecheck/TcExpr.hs
compiler/typecheck/TcTyClsDecls.hs
testsuite/tests/typecheck/should_fail/T13311.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T13311.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T