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

bug in polymorphic variants #2377

Closed
vicuna opened this issue Feb 25, 2000 · 2 comments
Closed

bug in polymorphic variants #2377

vicuna opened this issue Feb 25, 2000 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Feb 25, 2000

Original bug ID: 42
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

The following interaction with the environment manifests a bug in Ocaml 2.99
on Windows NT :

let f : unit -> [A|B] = function () -> `A;;

val f : unit -> [A|B] =

let x = match f() with A->2 | B->3 | `C->4;;

Uncaught exception: Not_found

I was expecting to get a warning about the useless match clause (`C) and for
x to be bound to 2. Instead, I get the weird exception and I get kicked out
of the Ocaml environment and back to the shell prompt.


The following interaction with the environment manifests a bug in Ocaml 2.99 on Windows NT :
 
# let f : unit -> [`A|`B] = function () -> `A;;
val f : unit -> [`A|`B] = <fun>
# let x = match f() with `A->2 | `B->3 | `C->4;;
Uncaught exception: Not_found

I was expecting to get a warning about the useless match clause (`C) and for x to be bound to 2. Instead, I get the weird exception and I get kicked out of the Ocaml environment and back to the shell prompt.
 


@vicuna
Copy link
Author

vicuna commented Feb 28, 2000

Comment author: administrator

let f : unit -> [A|B] = function () -> `A;;

val f : unit -> [A|B] =

let x = match f() with A->2 | B->3 | `C->4;;

Uncaught exception: Not_found

This bug is already corrected in the CVS version.
There were a number of bad variant bugs in ocaml-2.99, so you have better
wait for ocaml-3.00 if you intend to heavily use them.

Thank you for the report anyway,

Jacques

@vicuna
Copy link
Author

vicuna commented Feb 28, 2000

Comment author: administrator

Fixed in 3.00

@vicuna vicuna closed this as completed Feb 28, 2000
@vicuna vicuna added the bug label Mar 19, 2019
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