Ocaml 5.5 compat#1406
Conversation
| depends: [ | ||
| "dune" {>= "3.21"} | ||
| "ocaml" {>= "4.08.0" & < "5.5"} | ||
| "ocaml" {>= "4.08.0" & <= "5.5.1"} |
There was a problem hiding this comment.
Actually thinking about it, why do we have an upper bound on odoc-parser? I can understand with odoc where every ocaml release breaks it, but the parser ought to be way less brittle.
There was a problem hiding this comment.
I agree, there is no reason to have this "minor release" upper bound!
4415c76 to
54a3814
Compare
|
I'd still like to clean the history, but the PR is ready for review. |
|
|
||
| val g' : (module M : Y) -> int | ||
|
|
||
| val g'' : (module Y) -> int |
There was a problem hiding this comment.
You should probably also add a test for polymorphic parameters:
val map2: ('a. 'a -> 'a) -> 'a * 'b -> 'a * 'bafter a quick look, I have the impression that the current document generation code is missing parentheses.
There was a problem hiding this comment.
Thanks! I'll add that today.
9a3678f to
4201c48
Compare
f91e2ab to
cdadeff
Compare
I rebased and cleaned the history. (And addressed ochtachron's comment) |
- pack_cstrs renamed to pack_constraints in Types.package - tpt_cstrs renamed to tpt_constraints in Typedtree.package_type - typ_cstrs renamed to typ_constraints in Typedtree.type_declaration - New Type_external/Ttype_external constructors for external types - New Tfunctor/Ttyp_functor constructors in type_desc/core_type_desc - New Local_opaque_item constructor in Shape.Uid - Typemod.path_of_module moved to Typedtree.path_of_module Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The way it works is not ideal: we create a synthetic parent id for each module argument (as they can be introduced multiple times with the same name in the same type expression). This id is hidden and we don't render links to hidden ids. This is slightly bad because: - The appearance of unresolved links suggest an error when there is no. - There is no way to distinguish module args from normal modules But let's say it is a good first step! Co-authored-by: xvw <xavier.vdw@gmail.com>
Co-authored-by: Kate <kit-ty-kate@exn.st>
cdadeff to
fdf71a2
Compare
|
Rebased since the merge of #1404 |
xvw
left a comment
There was a problem hiding this comment.
For what it's worth, and judging by the output results!
|
On the subject of the module argument, I was wondering if it would not better to link Nevertheless, I agree that this can be improved later. |
Would you link the same way when the type is replaced? module type S = sig type t = float end
val f : (module M : S with type t = int) -> M.tI would find it misleading! The way to improve I can think of are too involved for this initial support... |
|
Your example is a type error, thus I am not sure how illustrative it is. module type S = sig type t end
val f : (module M : S with type t = int) -> M.tin which case is not that clear what is the best option between linking to Anyway, I agree that this is probably best left for further refinement. |
|
Looks good! I came across some test failures when I was looking through it though, so I've fixed them (very minor). As soon as CI shows green we'll merge! |
CHANGES: - Allow persistent latex macros in HTML/KaTeX backend (@dlesbre, ocaml/odoc#1391) - `markdown-generate` command now accepts multiple `.odocl` files in a single invocation, eliminating the need for shell scripting (@davesnx, ocaml/odoc#1387) - Support for OxCaml (@lukemaurer, @art-w, ocaml/odoc#1399) - OCaml 5.5.0 support (@panglesd, @xvw, ocaml/odoc#1406) - Fix compile-time crashing bugs ocaml/odoc#930 and ocaml/odoc#1385 (@jonludlam, ocaml/odoc#1400) - Markdown backend assumes ocaml as langId on declarations - Markdown backend collects all code snippets and render a single code block with comments, rather than split the variants/records per constructor/field - Fix URL remapping for page references (@jonludlam, ocaml/odoc#1395) - Fix ocaml/odoc#1396, which broke incrememntal builds (@jonludlam, ocaml/odoc#1402) - Ensure all warnings turn into errors with --warn-error (@jonludlam, ocaml/odoc#1402) - Fix missing parentheses for polymorphic arguments (@art-w, ocaml/odoc#1404)
Support for 5.5 with:
The second one is trickier. In this PR, at least:
However, the path referencing the module argument appear as unresolved links: underlined in red, suggesting an error...
The state of the PR is draft because it needs to be cleaned up and improved, but I already open it in case someone wants to try odoc on OCaml 5.5.
🤖 Generated with @xvw