From 1393a37509d22a27cb1b3201d4f64820bfba4c7a Mon Sep 17 00:00:00 2001 From: octachron Date: Mon, 6 Apr 2020 15:51:55 +0200 Subject: [PATCH] ocamldoc: fix printing of (::) --- Changes | 3 +++ ocamldoc/odoc_sig.ml | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index af1cf4547..77895deff 100644 --- a/Changes +++ b/Changes @@ -373,6 +373,9 @@ Working version - #8747, #9709: incorrect principality warning on functional updates of records (Jacques Garrigue, report and review by Thomas Refis) +- #9421, #9427: fix printing of (::) in ocamldoc + (Florian Angeletti, report by Yawar Amin, review by Damien Doligez) + - #9469: Better backtraces for lazy values (Leo White, review by Nicolás Ojeda Bär) diff --git a/ocamldoc/odoc_sig.ml b/ocamldoc/odoc_sig.ml index 9e4d1e445..d52dee893 100644 --- a/ocamldoc/odoc_sig.ml +++ b/ocamldoc/odoc_sig.ml @@ -388,8 +388,14 @@ module Analyser = | Cstr_record l -> Cstr_record (List.map (get_field env name_comment_list) l) in + let vc_name = match constructor_name with + | "::" -> + (* The only infix constructor is always printed (::) *) + "(::)" + | s -> s + in { - vc_name = constructor_name ; + vc_name; vc_args; vc_ret = Option.map (Odoc_env.subst_type env) ret_type; vc_text = comment_opt