File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -1576,14 +1576,10 @@ and expansion_of_module_path :
1576
1576
in
1577
1577
expansion_of_module_cached env p' m >> = function
1578
1578
| Signature sg ->
1579
- let sg' =
1580
- match m.doc with
1581
- | [] -> sg
1582
- | doc -> { sg with doc }
1579
+ let sg =
1580
+ if strengthen then Strengthen. signature (`Resolved p') sg else sg
1583
1581
in
1584
- if strengthen then
1585
- Ok (Signature (Strengthen. signature (`Resolved p') sg'))
1586
- else Ok (Signature sg')
1582
+ Ok (Signature sg)
1587
1583
| Functor _ as f -> Ok f)
1588
1584
| Error _ when Cpath. is_module_forward path -> Error `UnresolvedForwardPath
1589
1585
| Error e -> Error (`UnresolvedPath (`Module (path, e)))
@@ -1719,7 +1715,16 @@ and expansion_of_module :
1719
1715
Env. t ->
1720
1716
Component.Module. t ->
1721
1717
(expansion , expansion_of_module_error ) Result. result =
1722
- fun env m -> expansion_of_module_decl env m.type_
1718
+ fun env m ->
1719
+ expansion_of_module_decl env m.type_ >> = function
1720
+ | Signature sg ->
1721
+ let sg =
1722
+ (* Override the signature's documentation when the module also has
1723
+ a comment attached. *)
1724
+ match m.doc with [] -> sg | doc -> { sg with doc }
1725
+ in
1726
+ Ok (Signature sg)
1727
+ | Functor _ as f -> Ok f
1723
1728
1724
1729
and expansion_of_module_cached :
1725
1730
Env. t ->
You can’t perform that action at this time.
0 commit comments