Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000042OCamlOCaml generalpublic2000-02-25 15:222000-02-28 02:34
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000042: bug in polymorphic variants
DescriptionThe 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.
 

----------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">


<META content="MSHTML 5.00.2920.0" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT size=2><SPAN class=965521823-25022000>The following interaction with
the environment manifests a bug in Ocaml 2.99 on Windows NT
:</SPAN></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2># 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</FONT></DIV>

<DIV><FONT size=2><SPAN class=559073721-25022000><SPAN
class=965521823-25022000>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.</SPAN></SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=559073721-25022000><SPAN
class=965521823-25022000></SPAN></SPAN></FONT> </DIV>
<DIV><SPAN class=559073721-25022000></DIV></SPAN></BODY></HTML>

----------------
----------------
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000309)
administrator (administrator)
2000-02-28 02:33

> # 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

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
(0000310)
administrator (administrator)
2000-02-28 02:34

Fixed in 3.00

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker