Fix infix record field fixity (#11167 and #11173).

Authored by adamgundry on Dec 11 2015, 3:43 PM.

Description

Fix infix record field fixity (Trac #11167 and Trac #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: Trac #11167, Trac #11173

Details

Committed
bgamariDec 11 2015, 3:44 PM
Pushed
bgamariAug 25 2016, 1:39 PM
Reviewer
bgamari
Differential Revision
D1600: Fix infix record field fixity (#11167 and #11173).
Parents
rGHCDIFFceaf0f4683a3: testsuite: Only run recomp015 on ELF-based platforms
Branches
Unknown
Tags
Unknown