@@ -272,6 +272,11 @@ module Anchor = struct
272
272
let page = Path. from_identifier parent in
273
273
Ok { page; anchor = str_name; kind }
274
274
275
+ (* This is needed to ensure that references to polymorphic constructors have
276
+ links that use the right suffix: those resolved references are turned into
277
+ _constructor_ identifiers. *)
278
+ let suffix_for_constructor x = x
279
+
275
280
let rec from_identifier : Identifier.t -> (t, Error.t) result =
276
281
let open Error in
277
282
function
@@ -371,7 +376,7 @@ module Anchor = struct
371
376
| { iv = `Constructor (parent , name ); _ } ->
372
377
from_identifier (parent :> Identifier.t ) >> = fun page ->
373
378
let kind = `Constructor in
374
- let suffix = ConstructorName. to_string name in
379
+ let suffix = suffix_for_constructor ( ConstructorName. to_string name) in
375
380
Ok (add_suffix ~kind page suffix)
376
381
| { iv = `Field (parent , name ); _ } ->
377
382
from_identifier (parent :> Identifier.t ) >> = fun page ->
@@ -424,7 +429,7 @@ module Anchor = struct
424
429
add_suffix ~kind url suffix
425
430
| Constructor { name; _ } ->
426
431
let kind = `Constructor in
427
- let suffix = name in
432
+ let suffix = suffix_for_constructor name in
428
433
add_suffix ~kind url suffix)
429
434
430
435
(* * The anchor looks like
0 commit comments