Improve the error messages for static forms.
authorFacundo Domínguez <facundo.dominguez@tweag.io>
Thu, 9 Jun 2016 15:37:42 +0000 (17:37 +0200)
committerBen Gamari <ben@smart-cactus.org>
Thu, 9 Jun 2016 16:31:03 +0000 (18:31 +0200)
commite9dfb6e51f0cd585611a742ce7167e307ee7e7e8
treeadf483df67f7dd2473473a07ab0474c2bc1a5414
parentb020db2a841c397a02ec352f8b6dc110b38b927b
Improve the error messages for static forms.

Now the message explains why closed variables are not closed when
encountered in the body of (static ...).

This required adding to the local environment the free variables of
the local bindings in scope. Thus we can analyze and explain why a
variable is not closed when encountered.

Test Plan: ./validate

Reviewers: austin, simonpj, bgamari

Reviewed By: bgamari

Subscribers: mboes, thomie

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

GHC Trac Issues: #12003
compiler/typecheck/TcBinds.hs
compiler/typecheck/TcEnv.hs
compiler/typecheck/TcExpr.hs
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcRnTypes.hs
testsuite/tests/rename/should_fail/RnStaticPointersFail01.stderr
testsuite/tests/rename/should_fail/RnStaticPointersFail03.hs
testsuite/tests/rename/should_fail/RnStaticPointersFail03.stderr
testsuite/tests/rename/should_fail/all.T