Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Crash when finalising lazy values of the wrong type. #6664
Original bug ID: 6664
When you finalise a value of type [int lazy], you get a crash.
I'm not sure what the behavior should be in that case.
Steps to reproduce
With ocamlc, ocamlopt, or the toplevel:
let f x =
Comment author: @damiendoligez
After thinking about it and discussing with some users, it seems clear that Gc.finalise should raise Invalid_argument when called on a lazy or a float, because these types are not (always) represented by heap blocks.
Unfortunately, the run-time test for lazy is not exact: some lazy values (the ones that are already forwarded) cannot be detected as such. This will have to be documented.