Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005525OCamlOCaml typingpublic2012-03-07 11:462014-02-12 22:26
Reporterfrisch 
Assigned Togarrigue 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.01.0+dev 
Summary0005525: Resolving record fields using all specified fields
DescriptionWith 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.
TagsNo tags attached.
Attached Files

- Relationships
related to 0005528assignedfrisch Inline records for constructor arguments 
related to 0004172closedweis Duplicated record names in distinct types 
child of 0005759resolvedgarrigue Using well-disciplined type-propagation to disambiguate label and constructor names 

-  Notes
(0008561)
frisch (developer)
2012-12-04 17:11

Included in the record_disambiguation branch (0005759).
(0008590)
garrigue (manager)
2012-12-07 15:32

Included in the branch record-disambiguation, which was merged into trunk on 2012-12-06, at revision 13112.

- Issue History
Date Modified Username Field Change
2012-03-07 11:46 frisch New Issue
2012-03-08 18:47 gasche Relationship added related to 0005528
2012-03-26 14:30 lefessan Status new => acknowledged
2012-03-26 14:31 lefessan Severity minor => feature
2012-12-04 17:10 frisch Relationship added child of 0005759
2012-12-04 17:11 frisch Note Added: 0008561
2012-12-07 15:32 garrigue Note Added: 0008590
2012-12-07 15:32 garrigue Status acknowledged => resolved
2012-12-07 15:32 garrigue Fixed in Version => 4.01.0+dev
2012-12-07 15:32 garrigue Resolution open => fixed
2012-12-07 15:32 garrigue Assigned To => garrigue
2014-02-12 22:26 yallop Relationship added related to 0004172


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker