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

optional argument does not work when Some is redefined #4884

Closed
vicuna opened this issue Oct 2, 2009 · 1 comment
Closed

optional argument does not work when Some is redefined #4884

vicuna opened this issue Oct 2, 2009 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Oct 2, 2009

Original bug ID: 4884
Reporter: laurent
Status: closed (set by @garrigue on 2010-04-30T03:08:56Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.1
Fixed in version: 3.12.0+dev
Category: ~DO NOT USE (was: OCaml general)
Has duplicate: #5075
Related to: #4937
Monitored by: @ygrek

Bug description

The following code fails:
module M = struct
type t = Some of int
let f ?(v2=0) v1 = v1 + v2
end
The problem is probably that optional arguments are soon translated in some other code that uses the Some constructor without specifying the module (Pervasives.Some).
I agree that defining a new Some constructor is probably a bad practice but if OCaml relies on Some not being redefined, then redefining Some should produce an error.

@vicuna
Copy link
Author

vicuna commented Apr 30, 2010

Comment author: @garrigue

Fixed for 3.12, in revision 10329.
(Same technique as revision 8888)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant