[commit: ghc] master: Implement DuplicateRecordFields (b1884b0)
git at git.haskell.org
git at git.haskell.org
Fri Oct 16 15:28:09 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/b1884b0e62f62e3c0859515c4137124ab0c9560e/ghc
>---------------------------------------------------------------
commit b1884b0e62f62e3c0859515c4137124ab0c9560e
Author: Adam Gundry <adam at well-typed.com>
Date: Fri Oct 16 16:08:31 2015 +0100
Implement DuplicateRecordFields
This implements DuplicateRecordFields, the first part of the
OverloadedRecordFields extension, as described at
https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/DuplicateRecordFields
This includes fairly wide-ranging changes in order to allow multiple
records within the same module to use the same field names. Note that
it does *not* allow record selector functions to be used if they are
ambiguous, and it does not have any form of type-based disambiguation
for selectors (but it does for updates). Subsequent parts will make
overloading selectors possible using orthogonal extensions, as
described on the wiki pages. This part touches quite a lot of the
codebase, and requires changes to several GHC API datatypes in order
to distinguish between field labels (which may be overloaded) and
selector function names (which are always unique).
The Haddock submodule has been adapted to compile with the GHC API
changes, but it will need further work to properly support modules
that use the DuplicateRecordFields extension.
Test Plan: New tests added in testsuite/tests/overloadedrecflds; these
will be extended once the other parts are implemented.
Reviewers: goldfire, bgamari, simonpj, austin
Subscribers: sjcjoosten, haggholm, mpickering, bgamari, tibbe, thomie,
goldfire
Differential Revision: https://phabricator.haskell.org/D761
>---------------------------------------------------------------
b1884b0e62f62e3c0859515c4137124ab0c9560e
compiler/basicTypes/Avail.hs | 121 +++++-
compiler/basicTypes/ConLike.hs | 2 +-
compiler/basicTypes/DataCon.hs | 12 +-
compiler/basicTypes/DataCon.hs-boot | 3 +-
compiler/basicTypes/FieldLabel.hs | 132 +++++++
compiler/basicTypes/Id.hs | 12 +-
compiler/basicTypes/OccName.hs | 29 +-
compiler/basicTypes/RdrName.hs | 124 ++++--
compiler/basicTypes/SrcLoc.hs | 8 +-
compiler/deSugar/Check.hs | 5 +-
compiler/deSugar/Coverage.hs | 12 +-
compiler/deSugar/DsExpr.hs | 26 +-
compiler/deSugar/DsMeta.hs | 25 +-
compiler/deSugar/DsMonad.hs | 1 +
compiler/deSugar/MatchCon.hs | 3 +-
compiler/ghc.cabal.in | 2 +
compiler/ghc.mk | 2 +
compiler/hsSyn/Convert.hs | 23 +-
compiler/hsSyn/HsDecls.hs | 9 +-
compiler/hsSyn/HsExpr.hs | 9 +-
compiler/hsSyn/HsImpExp.hs | 44 ++-
compiler/hsSyn/HsPat.hs | 103 ++++-
compiler/hsSyn/HsTypes.hs | 93 ++++-
compiler/hsSyn/HsUtils.hs | 69 ++--
compiler/hsSyn/PlaceHolder.hs | 6 +-
compiler/iface/BuildTyCl.hs | 2 +-
compiler/iface/IfaceSyn.hs | 74 ++--
compiler/iface/LoadIface.hs | 15 +-
compiler/iface/MkIface.hs | 32 +-
compiler/iface/TcIface.hs | 23 +-
compiler/main/DynFlags.hs | 5 +
compiler/main/GHC.hs | 19 +-
compiler/main/HscTypes.hs | 11 +-
compiler/parser/Parser.y | 6 +-
compiler/parser/RdrHsSyn.hs | 14 +-
compiler/prelude/PrelInfo.hs | 2 +-
compiler/rename/RnEnv.hs | 192 +++++++---
compiler/rename/RnExpr.hs | 11 +-
compiler/rename/RnNames.hs | 425 +++++++++++++++------
compiler/rename/RnPat.hs | 161 +++++---
compiler/rename/RnSource.hs | 74 +---
compiler/rename/RnTypes.hs | 42 +-
compiler/typecheck/Inst.hs | 3 +-
compiler/typecheck/TcEnv.hs | 18 +-
compiler/typecheck/TcExpr.hs | 384 +++++++++++++++----
compiler/typecheck/TcGenDeriv.hs | 11 +-
compiler/typecheck/TcGenGenerics.hs | 2 +-
compiler/typecheck/TcHsSyn.hs | 18 +-
compiler/typecheck/TcPat.hs | 23 +-
compiler/typecheck/TcRnDriver.hs | 6 +-
compiler/typecheck/TcRnMonad.hs | 4 +-
compiler/typecheck/TcRnTypes.hs | 24 +-
compiler/typecheck/TcSplice.hs | 2 +-
compiler/typecheck/TcTyClsDecls.hs | 63 ++-
compiler/types/TyCon.hs | 53 ++-
compiler/types/TyCon.hs-boot | 1 -
compiler/utils/FastStringEnv.hs | 75 ++++
testsuite/tests/driver/T4437.hs | 1 +
testsuite/tests/module/mod176.stderr | 2 +-
.../tests/{ado => overloadedrecflds}/Makefile | 0
.../ghci}/Makefile | 0
testsuite/tests/overloadedrecflds/ghci/all.T | 3 +
.../ghci/overloadedrecfldsghci01.script | 17 +
.../ghci/overloadedrecfldsghci01.stdout | 26 ++
.../should_fail}/Makefile | 0
.../should_fail/OverloadedRecFldsFail04_A.hs | 9 +
.../should_fail/OverloadedRecFldsFail06_A.hs | 16 +
.../should_fail/OverloadedRecFldsFail10_A.hs | 5 +
.../should_fail/OverloadedRecFldsFail10_B.hs | 6 +
.../should_fail/OverloadedRecFldsFail10_C.hs | 6 +
.../should_fail/OverloadedRecFldsFail12_A.hs | 5 +
.../tests/overloadedrecflds/should_fail/all.T | 22 ++
.../should_fail/overloadedrecfldsfail01.hs | 19 +
.../should_fail/overloadedrecfldsfail01.stderr | 16 +
.../should_fail/overloadedrecfldsfail02.hs | 9 +
.../should_fail/overloadedrecfldsfail02.stderr | 6 +
.../should_fail/overloadedrecfldsfail03.hs | 10 +
.../should_fail/overloadedrecfldsfail03.stderr | 5 +
.../should_fail/overloadedrecfldsfail04.hs | 12 +
.../should_fail/overloadedrecfldsfail04.stderr | 11 +
.../should_fail/overloadedrecfldsfail05.hs | 10 +
.../should_fail/overloadedrecfldsfail05.stderr | 6 +
.../should_fail/overloadedrecfldsfail06.hs | 18 +
.../should_fail/overloadedrecfldsfail06.stderr | 31 ++
.../should_fail/overloadedrecfldsfail07.hs | 9 +
.../should_fail/overloadedrecfldsfail07.stderr | 6 +
.../should_fail/overloadedrecfldsfail08.hs | 11 +
.../should_fail/overloadedrecfldsfail08.stderr | 5 +
.../should_fail/overloadedrecfldsfail09.hs | 11 +
.../should_fail/overloadedrecfldsfail09.stderr | 4 +
.../should_fail/overloadedrecfldsfail10.hs | 11 +
.../should_fail/overloadedrecfldsfail10.stderr | 14 +
.../should_fail/overloadedrecfldsfail11.hs | 5 +
.../should_fail/overloadedrecfldsfail11.stderr | 4 +
.../should_fail/overloadedrecfldsfail12.hs | 12 +
.../should_fail/overloadedrecfldsfail12.stderr | 13 +
.../should_run}/Makefile | 0
.../should_run/OverloadedRecFldsRun02_A.hs | 9 +
testsuite/tests/overloadedrecflds/should_run/all.T | 9 +
.../should_run/overloadedrecfldsrun01.hs | 28 ++
.../should_run/overloadedrecfldsrun01.stdout | 0
.../should_run/overloadedrecfldsrun02.hs | 6 +
.../should_run/overloadedrecfldsrun02.stdout | 0
.../should_run/overloadedrecfldsrun03.hs | 25 ++
.../should_run/overloadedrecfldsrun03.stdout | 0
.../should_run/overloadedrecfldsrun04.hs | 17 +
.../should_run/overloadedrecfldsrun04.stdout | 2 +
.../should_run/overloadedrecfldsrun05.hs | 27 ++
.../should_run/overloadedrecfldsrun05.stdout | 4 +
.../tests/rename/should_compile/T7145b.stderr | 2 +-
testsuite/tests/rename/should_fail/T5892a.stderr | 2 +-
utils/ghctags/Main.hs | 2 +-
utils/haddock | 2 +-
113 files changed, 2440 insertions(+), 741 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b1884b0e62f62e3c0859515c4137124ab0c9560e
More information about the ghc-commits
mailing list