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

problem with optional arguments when defining a type with a "Some of <type>" constructor #5075

Closed
vicuna opened this Issue Jun 15, 2010 · 1 comment

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

vicuna commented Jun 15, 2010

Original bug ID: 5075
Reporter: nobelius
Status: closed (set by @garrigue on 2010-06-16T01:25:55Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.1
Fixed in version: 3.12.0+dev
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #4884

Bug description

When compiling with "ocamlc -c" the following code:
"type t = Some of int
let func ?(modifies=ref false) _ = ()"
the following error is obtained:
"File "test.ml", line 2, characters 20-29:
Error: This pattern matches values of type 'a option
but a pattern was expected which matches values of type t"
This is due to the fact that optional arguments "are actually implemented as option types". This could have been avoided if option type was defined in Pervasives but it is a built-in type.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 16, 2010

Comment author: @garrigue

Already fixed for 3.12.

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.