@@ -272,6 +272,11 @@ module Anchor = struct
272272 let page = Path. from_identifier parent in
273273 Ok { page; anchor = str_name; kind }
274274
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+
275280 let rec from_identifier : Identifier.t -> (t, Error.t) result =
276281 let open Error in
277282 function
@@ -371,7 +376,7 @@ module Anchor = struct
371376 | { iv = `Constructor (parent , name ); _ } ->
372377 from_identifier (parent :> Identifier.t ) >> = fun page ->
373378 let kind = `Constructor in
374- let suffix = ConstructorName. to_string name in
379+ let suffix = suffix_for_constructor ( ConstructorName. to_string name) in
375380 Ok (add_suffix ~kind page suffix)
376381 | { iv = `Field (parent , name ); _ } ->
377382 from_identifier (parent :> Identifier.t ) >> = fun page ->
@@ -424,7 +429,7 @@ module Anchor = struct
424429 add_suffix ~kind url suffix
425430 | Constructor { name; _ } ->
426431 let kind = `Constructor in
427- let suffix = name in
432+ let suffix = suffix_for_constructor name in
428433 add_suffix ~kind url suffix)
429434
430435 (* * The anchor looks like
0 commit comments