jon.recoil.org

Module Ocaml_typing.Typemod

Type-checking of the module language and typed ast hooks

Warning: this module is unstable and part of compiler-libs.

module Signature_names : sig ... end
val check_nongen_signature : Ocaml_typing.Env.t -> Ocaml_typing.Types.signature -> unit
val initial_env : loc:Ocaml_parsing.Location.t -> initially_opened_module:string option -> open_implicit_modules:string list -> Ocaml_typing.Env.t
module Sig_component_kind : sig ... end
type hiding_error =
  1. | Illegal_shadowing of {
    1. shadowed_item_id : Ocaml_typing.Ident.t;
    2. shadowed_item_kind : Ocaml_typing.Typemod.Sig_component_kind.t;
    3. shadowed_item_loc : Ocaml_parsing.Location.t;
    4. shadower_id : Ocaml_typing.Ident.t;
    5. user_id : Ocaml_typing.Ident.t;
    6. user_kind : Ocaml_typing.Typemod.Sig_component_kind.t;
    7. user_loc : Ocaml_parsing.Location.t;
    }
  2. | Appears_in_signature of {
    1. opened_item_id : Ocaml_typing.Ident.t;
    2. opened_item_kind : Ocaml_typing.Typemod.Sig_component_kind.t;
    3. user_id : Ocaml_typing.Ident.t;
    4. user_kind : Ocaml_typing.Typemod.Sig_component_kind.t;
    5. user_loc : Ocaml_parsing.Location.t;
    }
type functor_dependency_error =
  1. | Functor_applied
  2. | Functor_included
type legacy_module =
  1. | Compilation_unit
  2. | Toplevel
  3. | Functor_body

Modules that are required to be legacy mode

type unsupported_modal_module =
  1. | Functor_param
  2. | Functor_res

Places where modes annotations are not supported

type error =
  1. | Cannot_apply of Ocaml_typing.Types.module_type
  2. | Not_included of Ocaml_typing.Includemod.explanation
  3. | Not_included_functor of Ocaml_typing.Includemod.explanation
  4. | Cannot_eliminate_dependency of Ocaml_typing.Typemod.functor_dependency_error * Ocaml_typing.Types.module_type
  5. | Signature_expected
  6. | Structure_expected of Ocaml_typing.Types.module_type
  7. | Functor_expected of Ocaml_typing.Types.module_type
  8. | Signature_parameter_expected of Ocaml_typing.Types.module_type
  9. | Signature_result_expected of Ocaml_typing.Types.module_type
  10. | Recursive_include_functor
  11. | With_no_component of Ocaml_parsing.Longident.t
  12. | With_mismatch of Ocaml_parsing.Longident.t * Ocaml_typing.Includemod.explanation
  13. | With_makes_applicative_functor_ill_typed of Ocaml_parsing.Longident.t * Ocaml_typing.Path.t * Ocaml_typing.Includemod.explanation
  14. | With_changes_module_alias of Ocaml_parsing.Longident.t * Ocaml_typing.Ident.t * Ocaml_typing.Path.t
  15. | With_cannot_remove_constrained_type
  16. | With_package_manifest of Ocaml_parsing.Longident.t * Ocaml_typing.Types.type_expr
  17. | Repeated_name of Ocaml_typing.Typemod.Sig_component_kind.t * string
  18. | Non_generalizable of {
    1. vars : Ocaml_typing.Types.type_expr list;
    2. expression : Ocaml_typing.Types.type_expr;
    }
  19. | Non_generalizable_module of {
    1. vars : Ocaml_typing.Types.type_expr list;
    2. item : Ocaml_typing.Types.value_description;
    3. mty : Ocaml_typing.Types.module_type;
    }
  20. | Implementation_is_required of string
  21. | Interface_not_compiled of string
  22. | Not_allowed_in_functor_body
  23. | Not_includable_in_functor_body
  24. | Not_a_packed_module of Ocaml_typing.Types.type_expr
  25. | Incomplete_packed_module of Ocaml_typing.Types.type_expr
  26. | Scoping_pack of Ocaml_parsing.Longident.t * Ocaml_typing.Types.type_expr
  27. | Recursive_module_require_explicit_type
  28. | Apply_generative
  29. | Cannot_scrape_alias of Ocaml_typing.Path.t
  30. | Cannot_scrape_package_type of Ocaml_typing.Path.t
  31. | Badly_formed_signature of string * Ocaml_typing.Typedecl.error
  32. | Cannot_hide_id of Ocaml_typing.Typemod.hiding_error
  33. | Invalid_type_subst_rhs
  34. | Non_packable_local_modtype_subst of Ocaml_typing.Path.t
  35. | With_cannot_remove_packed_modtype of Ocaml_typing.Path.t * Ocaml_typing.Types.module_type
  36. | Strengthening_mismatch of Ocaml_parsing.Longident.t * Ocaml_typing.Includemod.explanation
  37. | Cannot_pack_parameter
  38. | Compiling_as_parameterised_parameter
  39. | Cannot_compile_implementation_as_parameter
  40. | Cannot_implement_parameter of Ocaml_typing.Compilation_unit.Name.t * Merlin_utils.Misc.filepath
  41. | Argument_for_non_parameter of Ocaml_typing.Global_module.Name.t * Merlin_utils.Misc.filepath
  42. | Cannot_find_argument_type of Ocaml_typing.Global_module.Parameter_name.t
  43. | Inconsistent_argument_types of {
    1. new_arg_type : Ocaml_typing.Global_module.Parameter_name.t option;
    2. old_arg_type : Ocaml_typing.Global_module.Parameter_name.t option;
    3. old_source_file : Merlin_utils.Misc.filepath;
    }
  44. | Duplicate_parameter_name of Ocaml_typing.Global_module.Parameter_name.t
  45. | Submode_failed of Ocaml_typing.Mode.Value.error
  46. | Item_weaker_than_structure of Ocaml_typing.Mode.Value.error
  47. | Unsupported_modal_module of Ocaml_typing.Typemod.unsupported_modal_module
  48. | Legacy_module of Ocaml_typing.Typemod.legacy_module * Ocaml_typing.Mode.Value.error
exception Error_forward of Ocaml_parsing.Location.error
val reset : preserve_persistent_env:bool -> unit

Clear several bits of global state that may retain large amounts of memory after typechecking is finished.

val normalize_signature : Ocaml_typing.Types.signature -> unit