Skip to content

Commit

Permalink
Add comment about type_is_recursive being an approx.
Browse files Browse the repository at this point in the history
  • Loading branch information
patricoferris committed Aug 24, 2024
1 parent 94b912e commit f16b0d3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/common.mli
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,20 @@ val get_type_param_name : core_type * (variance * injectivity) -> string Loc.t
(** [(new type_is_recursive rec_flag tds)#go ()] returns whether [rec_flag, tds]
is really a recursive type. We disregard recursive occurrences appearing in
arrow types. You can override the search for certain type expressions by
inheriting from this class. *)
inheriting from this class.
Note that this is an {b approximation} due to global and/or local openings
of modules.
{[
module M = struct
type t = Foo
end
type t = M.(t)
]}
The outer [t] will return [Recursive] even though it is not. *)
class type_is_recursive : rec_flag -> type_declaration list -> object
inherit Ast_traverse0.iter
val type_names : string list
Expand All @@ -45,7 +58,8 @@ class type_is_recursive : rec_flag -> type_declaration list -> object
end

val really_recursive : rec_flag -> type_declaration list -> rec_flag
(** [really_recursive rec_flag tds = (new type_is_recursive rec_flag tds)#go ()] *)
(** [really_recursive rec_flag tds = (new type_is_recursive rec_flag tds)#go ()].
See the documentation for {! type_is_recursive}.*)

val loc_of_payload : attribute -> Location.t
val loc_of_attribute : attribute -> Location.t
Expand Down

0 comments on commit f16b0d3

Please sign in to comment.