Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005835OCamlOCaml generalpublic2012-11-19 18:502013-02-19 04:14
Reporterelnatan 
Assigned Togarrigue 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.12.0 
Target VersionFixed in Version4.01.0+dev 
Summary0005835: Nonoptional labeled arguments can be passed with '?'. This is confusing
DescriptionI was surprised to find that the following works. I would have expected an error of some kind.

let f ~x = x + 1;;
let _ = f ?x:0;;

Is this a bug or a feature?
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0008535)
garrigue (manager)
2012-11-20 03:15

This is a bug.
Allowing it would be a contradiction.
For instance this code fails to type:
   let g f = f ?x:0
(0008653)
garrigue (manager)
2012-12-27 04:16

Fix in trunk, at revision 13163.
Will not merge into 4.00 branch, since the previous behavior was not dangerous.
(0008861)
doligez (administrator)
2013-02-18 20:11

Note: this bug fix breaks lablgtk (tested on version 2.14.2 and 2.16.0).
(0008865)
garrigue (manager)
2013-02-19 04:14
edited on: 2013-02-19 04:16

Replaced the error by a warning, as this appears to break lots of code, and this is only a question of principality of inference (there is no semantical problem).
Committed in trunk, revision 13298.

(Also fixed lablgtk, of course; thanks for the report)


- Issue History
Date Modified Username Field Change
2012-11-19 18:50 elnatan New Issue
2012-11-20 03:15 garrigue Note Added: 0008535
2012-11-20 03:15 garrigue Assigned To => garrigue
2012-11-20 03:15 garrigue Status new => confirmed
2012-12-27 04:16 garrigue Note Added: 0008653
2012-12-27 04:16 garrigue Status confirmed => closed
2012-12-27 04:16 garrigue Resolution open => fixed
2012-12-27 04:16 garrigue Fixed in Version => 4.01.0+dev
2013-02-18 17:46 doligez Note Added: 0008860
2013-02-18 19:59 doligez Note Deleted: 0008860
2013-02-18 20:11 doligez Note Added: 0008861
2013-02-19 04:14 garrigue Note Added: 0008865
2013-02-19 04:16 garrigue Note Edited: 0008865 View Revisions


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker