Improvements/bugfixes to signature reexport handling.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Mon, 13 Feb 2017 00:02:44 +0000 (16:02 -0800)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Fri, 17 Feb 2017 21:51:19 +0000 (13:51 -0800)
commitfd2d5b6de7493c2ff2ac76401ef296f575c52483
tree44142c3ac7e641a1bf7980001136369394245a8a
parent22dba98f2b22141d8238d7e7a42141495945f1cf
Improvements/bugfixes to signature reexport handling.

Summary:
A number of changes:

- Keep the TcGblEnv from typechecking the local signature
  around when we do merging.  In particular, we setup
  tcg_imports and tcg_rdr_env according to the local
  signature.  This improves our error output (for example,
  see bkpfail04) and also fixes a bug with reexporting
  modules in signatures (see bkpreex07)

- Fix a bug in thinning, where if we had signature A(module A),
  this previously would have *thinned out* all of the inherited
  signatures.  Now we treat every inherited signature as having
  come from an import like "import A", so a module A reexport
  will pick them up.

- Recompilation checking now keeps track of dependent source files
  of the source signature; previously we forgot to retain this
  info.

There's a manual update too.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: bgamari, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D3133
15 files changed:
compiler/main/HscMain.hs
compiler/typecheck/TcBackpack.hs
docs/users_guide/separate_compilation.rst
testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stderr
testsuite/tests/backpack/reexport/all.T
testsuite/tests/backpack/reexport/bkpreex07.bkp [new file with mode: 0644]
testsuite/tests/backpack/reexport/bkpreex07.stderr [new file with mode: 0644]
testsuite/tests/backpack/reexport/bkpreex08.bkp [new file with mode: 0644]
testsuite/tests/backpack/reexport/bkpreex08.stderr [new file with mode: 0644]
testsuite/tests/backpack/reexport/bkpreex09.bkp [new file with mode: 0644]
testsuite/tests/backpack/reexport/bkpreex09.stderr [new file with mode: 0644]
testsuite/tests/backpack/reexport/bkpreex10.bkp [new file with mode: 0644]
testsuite/tests/backpack/reexport/bkpreex10.stderr [new file with mode: 0644]
testsuite/tests/backpack/should_fail/bkpfail04.stderr
testsuite/tests/backpack/should_fail/bkpfail42.stderr