Skip to content

Fix optional argument rendering in OCaml 5.5 - #1489

Open
jonludlam wants to merge 2 commits into
ocaml:masterfrom
jonludlam:fix-optional-arg-tpoly
Open

Fix optional argument rendering in OCaml 5.5#1489
jonludlam wants to merge 2 commits into
ocaml:masterfrom
jonludlam:fix-optional-arg-tpoly

Conversation

@jonludlam

Copy link
Copy Markdown
Member

In OCaml 5.5, optional arguments get wrapped in a TPoly constructor, confusing odoc. This results in rendering values such as:

val foo: ?arg:??? -> unit

This PR fixes this by unwrapping them from the TPoly.

jonludlam and others added 2 commits September 3, 2026 21:36
For a module with no mli, OCaml 5.5 wraps the argument types of the
inferred arrows in a trivial Tpoly node, which stops odoc recognising
the option beneath it: the arguments are marked RawOptional and render
as `?force:???`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
From 5.5 the compiler wraps the argument types of inferred arrows in a
trivial Tpoly node, so the loader no longer saw the option constructor
and marked the arguments RawOptional, rendering them as `?arg:???`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant