this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix assertion failure in odoc subst.ml for OxCaml mode types

Port fix from avsm/oxmono@1618948: when a module type path is replaced
during substitution, raise Invalidated instead of assert false, and
handle it in signature_fragment by unresolving the fragment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+10 -2
+10 -2
src/xref2/subst.ml
··· 446 446 let p = 447 447 match resolved_module_type_path t p with 448 448 | Not_replaced p -> p 449 - | Replaced _ -> assert false 449 + | Replaced _ -> 450 + (* The module type path was replaced by an expression. We can't keep 451 + it as a resolved fragment, so raise Invalidated to trigger 452 + unresolving. This can happen with OxCaml mode types. *) 453 + raise Invalidated 450 454 in 451 455 `Root (`ModuleType p) 452 456 | `Root (`Module p) -> `Root (`Module (resolved_module_path t p)) ··· 488 492 let rec signature_fragment : t -> Cfrag.signature -> Cfrag.signature = 489 493 fun t r -> 490 494 match r with 491 - | `Resolved f -> `Resolved (resolved_signature_fragment t f) 495 + | `Resolved f -> ( 496 + try `Resolved (resolved_signature_fragment t f) 497 + with Invalidated -> 498 + let frag' = Cfrag.unresolve_signature f in 499 + signature_fragment t frag') 492 500 | `Dot (sg, n) -> `Dot (signature_fragment t sg, n) 493 501 | `Root -> `Root 494 502