Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 6027c1d

Browse files
committed
Fix printing optional label.
1 parent 5dedb5b commit 6027c1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-libs-406/printtyp.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ and tree_of_constructor cd =
928928
and tree_of_label l =
929929
let opt = l.ld_attributes |> List.exists (fun ({txt}, _) -> txt = "optional") in
930930
let typ = match l.ld_type.desc with
931-
| Tconstr (p, [t1], _) when Path.same p Predef.path_option -> t1
931+
| Tconstr (p, [t1], _) when opt && Path.same p Predef.path_option -> t1
932932
| _ -> l.ld_type in
933933
(Ident.name l.ld_id, l.ld_mutable = Mutable, opt, tree_of_typexp false typ)
934934

0 commit comments

Comments
 (0)