File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,19 @@ let synopsis_of_module env (m : Component.Module.t) =
2828 | Ok sg -> synopsis_from_comment (Component. extract_signature_doc sg)
2929 | Error _ -> None )
3030
31+ let warn_if_contains_references ~location p =
32+ let is_ref = function
33+ | { Location_. value = `Reference _ ; _ } -> true
34+ | _ -> false
35+ in
36+ match p with
37+ | Some p when List. exists is_ref p ->
38+ Lookup_failures. with_location location (fun () ->
39+ Lookup_failures. report ~kind: `Warning
40+ " The synopsis from this module contains references that won't be \
41+ resolved when included in this list." )
42+ | _ -> ()
43+
3144exception Loop
3245
3346let rec is_forward : Paths.Path.Module.t -> bool = function
@@ -175,6 +188,7 @@ and comment_nestable_block_element env parent
175188 | Some (r , _ , m ) ->
176189 let module_reference = Location_. at location (`Resolved r)
177190 and module_synopsis = synopsis_of_module env m in
191+ warn_if_contains_references ~location module_synopsis;
178192 { Comment. module_reference; module_synopsis }
179193 | None -> r)
180194 refs
Original file line number Diff line number Diff line change 11# Testing {!modules:...} lists
22
33 $ compile external. mli starts_with_open. mli main. mli
4+ File " external.mli" , line 20 , characters 4 -36:
5+ The synopsis from this module contains references that won't be resolved when included in this list.
6+ File " main.mli" , line 1 , character 4 to line 3 , character 47 :
7+ The synopsis from this module contains references that won't be resolved when included in this list.
8+ File " main.mli" , line 1 , character 4 to line 3 , character 47 :
9+ The synopsis from this module contains references that won't be resolved when included in this list.
410
511Everything should resolve:
612
You can’t perform that action at this time.
0 commit comments