Gc.finalise and lazy values #7355
Closed
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original bug ID: 7355
Reporter: @yallop
Status: closed (set by @damiendoligez on 2016-09-28T11:46:40Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: documentation
Monitored by: braibant @dbuenzli
Bug description
The Gc module documentation says
Note that values of types [float] and ['a lazy] (for any ['a]) are
sometimes allocated and sometimes not, so finalising them is unsafe,
and [finalise] will also raise [Invalid_argument] for them.
https://github.com/ocaml/ocaml/blob/5c4c41ba/stdlib/gc.mli#L296-L298
However, passing a lazy value to Gc.finalise does not always raise an exception:
Gc.finalise ignore (lazy ignore);;
[There's also a second small bug above: the documentation has "'a lazy" where it should have "'a Lazy.t"]
The text was updated successfully, but these errors were encountered: