Add warn-missing-export-lists
authorEvan Rutledge Borden <eborden@frontrowed.com>
Tue, 21 Nov 2017 23:06:01 +0000 (18:06 -0500)
committerBen Gamari <ben@smart-cactus.org>
Wed, 22 Nov 2017 02:11:16 +0000 (21:11 -0500)
commit63e4ac37d7268e063cb6adcea89e1e8716c5de89
tree3d0a04ae40369f660f131e16a3708719adcd1b4a
parentf376ebac29d8dab023482a21ecfbc4dc032ab23e
Add warn-missing-export-lists

Many industrial users have aligned around the idea that implicit exports
are an anti-pattern. They lead to namespace pollution and byzantine
naming schemes. They also prevent GHC's dead code analysis and create
more obstacles to optimization. This warning allows teams/projects to
warn on or enforce via -Werror explicit export lists.

This warning also serves as a complement to warn-missing-import-lists.

This was originally discussed here:
https://github.com/ghc-proposals/ghc-proposals/pull/93

Test Plan: Three new minimal tests have been added to the type checker.

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D4197
compiler/main/DynFlags.hs
compiler/typecheck/TcRnExports.hs
docs/users_guide/8.4.1-notes.rst
docs/users_guide/using-warnings.rst
testsuite/tests/typecheck/should_compile/MissingExportList01.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/MissingExportList02.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T
testsuite/tests/typecheck/should_fail/MissingExportList03.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/MissingExportList03.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T