Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007696OCamltypingpublic2017-12-22 01:272018-03-08 17:01
Reporteryallop 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0007696: record expression deleted when all fields specified
DescriptionIn 4.03.0 the record expression in an field update was always evaluated:

   # { (assert false) with contents = 1 } ;;
   Characters 0-36:
     { (assert false) with contents = 1 } ;;
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   Warning 23: all the fields are explicitly listed in this record:
   the 'with' clause is useless.
   Exception: Assert_failure ("//toplevel//", 1, 2).

In more recent versions (4.04.2, 4.05.0, 4.06.0) the record expression is removed if all the fields are specified:

   # { (assert false) with contents = 1 } ;;
   Characters 0-36:
     { (assert false) with contents = 1 } ;;
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   Warning 23: all the fields are explicitly listed in this record:
   the 'with' clause is useless.
   - : int ref = {contents = 1}

There's previous discussion on Mantis and GitHub:

   https://caml.inria.fr/mantis/view.php?id=6608#c16416 [^]
   https://github.com/ocaml/ocaml/pull/901#issuecomment-259717609 [^]
TagsNo tags attached.
Attached Files

- Relationships
related to 0006608resolvedgarrigue Lax typing for functional record updates 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2017-12-22 01:27 yallop New Issue
2017-12-22 01:27 yallop Relationship added related to 0006608


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker