You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5525 Reporter:@alainfrisch Assigned to:@garrigue Status: closed (set by @xavierleroy on 2015-12-11T18:25:43Z) Resolution: fixed Priority: normal Severity: feature Fixed in version: 4.01.0+dev Category: typing Related to:#4172#5528 Child of:#5759 Monitored by:@gasche tgazagna @diml pveber @ygrek@hcarty
Bug description
With punning on record labels, programmers have a stronger incentive to use nice short names for record labels and avoid the disambiguation-by-prefixing technique.
The following proposal would make it possible, in some cases, to work with several record types that share some field names: when typing a record literal {[e0 with] l1 = e1; ... ; ln = en} or a record pattern {l1 = p1; ...; ln = pn}, the type-checker would search the current typing environment for a record type declaration that includes all the fields {l1, ..., ln}.
This cannot break existing well-typed code.
We have been using this modified resolution at LexiFi for a few years now. The patch is tiny. I can adapt it to the OCaml trunk if the proposal is accepted.
The text was updated successfully, but these errors were encountered:
Original bug ID: 5525
Reporter: @alainfrisch
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:25:43Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 4.01.0+dev
Category: typing
Related to: #4172 #5528
Child of: #5759
Monitored by: @gasche tgazagna @diml pveber @ygrek @hcarty
Bug description
With punning on record labels, programmers have a stronger incentive to use nice short names for record labels and avoid the disambiguation-by-prefixing technique.
The following proposal would make it possible, in some cases, to work with several record types that share some field names: when typing a record literal {[e0 with] l1 = e1; ... ; ln = en} or a record pattern {l1 = p1; ...; ln = pn}, the type-checker would search the current typing environment for a record type declaration that includes all the fields {l1, ..., ln}.
This cannot break existing well-typed code.
We have been using this modified resolution at LexiFi for a few years now. The patch is tiny. I can adapt it to the OCaml trunk if the proposal is accepted.
The text was updated successfully, but these errors were encountered: