Skip to content

Commit 2e6f623

Browse files
committed
Fix opt.
1 parent 3126a9b commit 2e6f623

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

analysis/tests/src/expected/Completion.res.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,13 +889,13 @@ Completable: Cpath Value[FAO, forAutoObject]["forAutoLabel"].""
889889
"label": "forAuto",
890890
"kind": 5,
891891
"tags": [],
892-
"detail": "forAuto: ForAuto.t\n\ntype forAutoRecord = {forAuto: ForAuto.t, something: int}",
892+
"detail": "forAuto: ForAuto.t\n\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option<int>,\n}",
893893
"documentation": null
894894
}, {
895895
"label": "something",
896896
"kind": 5,
897897
"tags": [],
898-
"detail": "something: option<int>\n\ntype forAutoRecord = {forAuto: ForAuto.t, something: int}",
898+
"detail": "something: option<int>\n\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option<int>,\n}",
899899
"documentation": null
900900
}]
901901

analysis/vendor/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)