Parmap.redirect, introduced in 236137fb12dd84b8d60bd7f6f9496d6032f85df2, has an optional argument that is not followed by any non-labelled argument. With this interface, OCaml can never deduce that the optional argument will never be passed by the user, so users have to use ?path:None explicitly to not pass a path.
One could fix this issue by making ~id a non-labelled argument, or by adding a dummy unit argument at the end.
The present commit simply silences the warning, which restores the build under OCaml 4.12 and later versions. The reason why this code only started failing in 4.12 is that the pre-4.12 implementation of the unerasable-optional-argument warning did not detect this case, and the warning check was widened for 4.12 by
https://github.com/ocaml/ocaml/pull/9783
Ideally it would be nice to change the interface of Parmap.redirect, but this would be an API-breaking change.
Parmap.redirect, introduced in 236137fb12dd84b8d60bd7f6f9496d6032f85df2, has an optional argument that is not followed by any non-labelled argument. With this interface, OCaml can never deduce that the optional argument will never be passed by the user, so users have to use ?path:None explicitly to not pass a path.
One could fix this issue by making
~id
a non-labelled argument, or by adding a dummy unit argument at the end.The present commit simply silences the warning, which restores the build under OCaml 4.12 and later versions. The reason why this code only started failing in 4.12 is that the pre-4.12 implementation of the unerasable-optional-argument warning did not detect this case, and the warning check was widened for 4.12 by https://github.com/ocaml/ocaml/pull/9783
Ideally it would be nice to change the interface of Parmap.redirect, but this would be an API-breaking change.