disambiguation: split the disambiguate comment in spec. and impl.

master
Gabriel Scherer 2019-12-18 08:56:17 +01:00
parent 44149ba7ca
commit a6df85f49f
1 changed files with 10 additions and 8 deletions

View File

@ -711,14 +711,16 @@ end) = struct
warn lid.loc
(Warnings.Disambiguated_name (get_name lbl))
(** [disambiguate] selects a concrete description for [lid] using some
contextual information: an optional [expected_type], and a list of candidates [lbls].
If [expected_type] is [None], it just returns the head of [lbls].
Otherwise, it extracts the description directly from the corresponding type definition,
except for extension types, where it has to choose it inside [lbls].
Here [scope] contains the labels equal to [lid] in the current environment,
and [lbls] is a (potentially strict) subset of [scope], see [disambiguate_label_by_ids] *)
(** [disambiguate] selects a concrete description for [lid] using
some contextual information: an optional [expected_type], and
a list of candidates [lbls]. If [expected_type] is [None], it
just returns the head of [lbls]. Otherwise, it extracts the
description directly from the corresponding type definition,
except for extension types, where it has to choose it inside
[lbls]. *)
(* Here [scope] contains the labels equal to [lid] in the current
environment, and [lbls] is a (potentially strict) subset of
[scope], see [disambiguate_label_by_ids] *)
let disambiguate ?(warn=Location.prerr_warning) ?scope
usage lid env expected_type lbls =
let scope = match scope with None -> lbls | Some l -> l in