Ocaml_typing.Typemod
SourceType-checking of the module language and typed ast hooks
Warning: this module is unstable and part of compiler-libs.
val type_module :
Env.t ->
Ocaml_parsing.Parsetree.module_expr ->
Typedtree.module_expr * Shape.t
val type_structure :
Env.t ->
Ocaml_parsing.Parsetree.structure ->
Typedtree.structure * Types.signature * Signature_names.t * Shape.t * Env.t
val type_toplevel_phrase :
Env.t ->
Ocaml_parsing.Parsetree.structure ->
Typedtree.structure * Types.signature * Shape.t * Env.t
val type_implementation :
string ->
string ->
string ->
Env.t ->
Ocaml_parsing.Parsetree.structure ->
Typedtree.implementation
val modtype_of_package :
Env.t ->
Ocaml_parsing.Location.t ->
Path.t ->
(Ocaml_parsing.Longident.t * Types.type_expr) list ->
Types.module_type
val save_signature :
string ->
Typedtree.signature ->
string ->
string ->
Env.t ->
Cmi_format.cmi_infos ->
unit
val initial_env :
loc:Ocaml_parsing.Location.t ->
initially_opened_module:string option ->
open_implicit_modules:string list ->
Env.t
type hiding_error =
| Illegal_shadowing of {
shadowed_item_id : Ident.t;
shadowed_item_kind : Sig_component_kind.t;
shadowed_item_loc : Ocaml_parsing.Location.t;
shadower_id : Ident.t;
user_id : Ident.t;
user_kind : Sig_component_kind.t;
user_loc : Ocaml_parsing.Location.t;
}
| Appears_in_signature of {
opened_item_id : Ident.t;
opened_item_kind : Sig_component_kind.t;
user_id : Ident.t;
user_kind : Sig_component_kind.t;
user_loc : Ocaml_parsing.Location.t;
}
type error =
| Cannot_apply of Types.module_type
| Not_included of Includemod.explanation
| Cannot_eliminate_dependency of Types.module_type
| Signature_expected
| Structure_expected of Types.module_type
| With_no_component of Ocaml_parsing.Longident.t
| With_mismatch of Ocaml_parsing.Longident.t * Includemod.explanation
| With_makes_applicative_functor_ill_typed of Ocaml_parsing.Longident.t
* Path.t
* Includemod.explanation
| With_changes_module_alias of Ocaml_parsing.Longident.t * Ident.t * Path.t
| With_cannot_remove_constrained_type
| Repeated_name of Sig_component_kind.t * string
| Non_generalizable of {
vars : Types.type_expr list;
expression : Types.type_expr;
}
| Non_generalizable_module of {
vars : Types.type_expr list;
item : Types.value_description;
mty : Types.module_type;
}
| Implementation_is_required of string
| Interface_not_compiled of string
| Not_allowed_in_functor_body
| Not_a_packed_module of Types.type_expr
| Incomplete_packed_module of Types.type_expr
| Scoping_pack of Ocaml_parsing.Longident.t * Types.type_expr
| Recursive_module_require_explicit_type
| Apply_generative
| Cannot_scrape_alias of Path.t
| Cannot_scrape_package_type of Path.t
| Badly_formed_signature of string * Typedecl.error
| Cannot_hide_id of hiding_error
| Invalid_type_subst_rhs
| Unpackable_local_modtype_subst of Path.t
| With_cannot_remove_packed_modtype of Path.t * Types.module_type
val report_error :
Env.t ->
loc:Ocaml_parsing.Location.t ->
error ->
Ocaml_parsing.Location.error
val merlin_type_structure :
Env.t ->
Ocaml_parsing.Parsetree.structure ->
Typedtree.structure * Types.signature * Env.t
val merlin_transl_signature :
Env.t ->
Ocaml_parsing.Parsetree.signature ->
Typedtree.signature