Rework renaming of children in export lists.
authorMatthew Pickering <matthewtpickering@gmail.com>
Sat, 8 Oct 2016 09:06:01 +0000 (10:06 +0100)
committerMatthew Pickering <matthewtpickering@gmail.com>
Sat, 8 Oct 2016 09:07:14 +0000 (10:07 +0100)
commite660f4bf546e90fb6719ad268ca3daaecdce4b82
tree7c23ed1a6983d951c8950f8105d3889914619d81
parent46b78e604c06c8878e436fea93729158dcf55269
Rework renaming of children in export lists.

The target of this patch is exports such as:

```
module Foo ( T(A, B, C) ) where
```

Essentially this patch makes sure that we use the correct lookup functions in order
to lookup the names in parent-children export lists. This change
highlighted the complexity of this small part of GHC which accounts for
the scale.

This change was motivated by wanting to
remove the `PatternSynonym` constructor from `Parent`. As with all these
things, it quickly spiraled out of control into a much larger refactor.

Reviewers: simonpj, goldfire, bgamari, austin

Subscribers: adamgundry, thomie

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

GHC Trac Issues: #11970
34 files changed:
compiler/basicTypes/Avail.hs
compiler/basicTypes/RdrName.hs
compiler/ghc.cabal.in
compiler/iface/LoadIface.hs
compiler/iface/MkIface.hs
compiler/main/HscTypes.hs
compiler/rename/RnEnv.hs
compiler/rename/RnExpr.hs
compiler/rename/RnNames.hs
compiler/rename/RnSource.hs
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcRnExports.hs [new file with mode: 0644]
compiler/typecheck/TcRnMonad.hs
compiler/typecheck/TcType.hs
compiler/types/TyCoRep.hs
compiler/utils/Util.hs
testsuite/tests/module/MultiExport.hs [new file with mode: 0644]
testsuite/tests/module/MultiExport.stderr [new file with mode: 0644]
testsuite/tests/module/T11970.hs [new file with mode: 0644]
testsuite/tests/module/T11970.stderr [new file with mode: 0644]
testsuite/tests/module/T11970A.hs [new file with mode: 0644]
testsuite/tests/module/T11970A.stderr [new file with mode: 0644]
testsuite/tests/module/T11970A1.hs [new file with mode: 0644]
testsuite/tests/module/T11970B.hs [new file with mode: 0644]
testsuite/tests/module/T11970B.stderr [new file with mode: 0644]
testsuite/tests/module/all.T
testsuite/tests/module/mod10.stderr
testsuite/tests/module/mod17.stderr
testsuite/tests/module/mod3.stderr
testsuite/tests/module/mod4.stderr
testsuite/tests/overloadedrecflds/should_fail/NoParent.hs [new file with mode: 0644]
testsuite/tests/overloadedrecflds/should_fail/NoParent.stderr [new file with mode: 0644]
testsuite/tests/overloadedrecflds/should_fail/all.T
testsuite/tests/patsyn/should_fail/export-class.stderr