[commit: ghc] master: Fix infix record field fixity (#11167 and #11173). (6e56ac5)
git at git.haskell.org
git at git.haskell.org
Fri Dec 11 22:17:30 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/6e56ac58a6905197412d58e32792a04a63b94d7e/ghc
>---------------------------------------------------------------
commit 6e56ac58a6905197412d58e32792a04a63b94d7e
Author: Adam Gundry <adam at well-typed.com>
Date: Fri Dec 11 22:43:26 2015 +0100
Fix infix record field fixity (#11167 and #11173).
This extends D1585 with proper support for infix duplicate record
fields. In particular, it is now possible to declare record fields as
infix in a module for which `DuplicateRecordFields` is enabled, fixity
is looked up correctly and a readable (although unpleasant) error
message is generated if multiple fields with different fixities are in
scope.
As a bonus, `DEPRECATED` and `WARNING` pragmas now work for
duplicate record fields. The pragma applies to all fields with the
given label.
In addition, a couple of minor `DuplicateRecordFields` bugs, which were
pinpointed by the `T11167_ambig` test case, are fixed by this patch:
- Ambiguous infix fields can now be disambiguated by putting a type
signature on the first argument
- Polymorphic type constructor signatures (such as `ContT () IO a` in
`T11167_ambig`) now work for disambiguation
Parts of this patch are from D1585 authored by @KaneTW.
Test Plan: New tests added.
Reviewers: KaneTW, bgamari, austin
Reviewed By: bgamari
Subscribers: thomie, hvr
Differential Revision: https://phabricator.haskell.org/D1600
GHC Trac Issues: #11167, #11173
>---------------------------------------------------------------
6e56ac58a6905197412d58e32792a04a63b94d7e
compiler/hsSyn/HsExpr.hs | 1 +
compiler/hsSyn/HsTypes.hs | 4 ++
compiler/main/HscTypes.hs | 12 +++--
compiler/rename/RnEnv.hs | 59 ++++++++++++++++++----
compiler/rename/RnExpr.hs | 7 +--
compiler/rename/RnNames.hs | 11 ++--
compiler/rename/RnSource.hs | 4 +-
compiler/typecheck/TcExpr.hs | 16 +++++-
.../overloadedrecflds/should_compile/T11173.hs | 6 +++
.../overloadedrecflds/should_compile/T11173a.hs | 10 ++++
.../tests/overloadedrecflds/should_compile/all.T | 1 +
...cfldsfail11.hs => OverloadedRecFldsFail11_A.hs} | 3 +-
.../should_fail/T11167_ambiguous_fixity.hs | 6 +++
.../should_fail/T11167_ambiguous_fixity.stderr | 16 ++++++
.../should_fail/T11167_ambiguous_fixity_A.hs | 5 ++
.../should_fail/T11167_ambiguous_fixity_B.hs | 3 ++
.../tests/overloadedrecflds/should_fail/all.T | 8 ++-
.../should_fail/overloadedrecfldsfail11.hs | 6 +--
.../should_fail/overloadedrecfldsfail11.stderr | 11 ++--
testsuite/tests/rename/should_compile/T11167.hs | 21 ++++++++
.../tests/rename/should_compile/T11167_ambig.hs | 23 +++++++++
testsuite/tests/rename/should_compile/all.T | 2 +
22 files changed, 201 insertions(+), 34 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 6e56ac58a6905197412d58e32792a04a63b94d7e
More information about the ghc-commits
mailing list