Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nonoptional labeled arguments can be passed with '?'. This is confusing #5835

Closed
vicuna opened this Issue Nov 19, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

vicuna commented Nov 19, 2012

Original bug ID: 5835
Reporter: elnatan
Assigned to: @garrigue
Status: closed (set by @garrigue on 2012-12-27T03:16:34Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.12.0
Fixed in version: 4.01.0+dev
Category: ~DO NOT USE (was: OCaml general)

Bug description

I 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?

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Nov 20, 2012

Comment author: @garrigue

This is a bug.
Allowing it would be a contradiction.
For instance this code fails to type:
let g f = f ?x:0

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Dec 27, 2012

Comment author: @garrigue

Fix in trunk, at revision 13163.
Will not merge into 4.00 branch, since the previous behavior was not dangerous.

@vicuna vicuna closed this Dec 27, 2012

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Feb 18, 2013

Comment author: @damiendoligez

Note: this bug fix breaks lablgtk (tested on version 2.14.2 and 2.16.0).

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Feb 19, 2013

Comment author: @garrigue

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)

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.