Module Ocaml_typing.Typetexp

type jkind_initialization_choice =
  1. | Sort
  2. | Any
module TyVarEnv : sig ... end
val valid_tyvar_name : string -> bool

transl_label lbl ty produces a Typedtree argument label for an argument with label lbl and type ty.

Position arguments (lbl:[%call_pos] -> ...) are parsed as Labelled l. This function converts them to Position l when the type is of the form [%call_pos].

Produces a Typedtree argument label, as well as the pattern corresponding to the argument. transl_label lbl pat is equal to:

  • Position l, P when lbl is Labelled l and pat represents (P : [%call_pos])
  • transl_label lbl None, pat otherwise.

Like transl_label_from_pat, but with special handling for expressions (E : [%call_pos]) instead of for patterns.

val transl_simple_type : Env.t -> new_var_jkind:jkind_initialization_choice -> ?univars:TyVarEnv.poly_univars -> closed:bool -> Mode.Alloc.Const.t -> Ocaml_parsing.Parsetree.core_type -> Typedtree.core_type
val transl_simple_type_univars : Env.t -> Ocaml_parsing.Parsetree.core_type -> Typedtree.core_type
val transl_simple_type_delayed : Env.t -> Mode.Alloc.Const.t -> Ocaml_parsing.Parsetree.core_type -> Typedtree.core_type * Types.type_expr * (unit -> unit)
val get_type_param_name : Ocaml_parsing.Parsetree.core_type -> string option
exception Already_bound
type value_loc =
  1. | Tuple
  2. | Poly_variant
  3. | Object_field
type sort_loc =
  1. | Fun_arg
  2. | Fun_ret
type cannot_quantify_reason
type jkind_info
type unbound_variable_reason
type error =
  1. | Unbound_type_variable of string * string list * unbound_variable_reason option
  2. | No_type_wildcards of unbound_variable_reason option
  3. | Undefined_type_constructor of Path.t
  4. | Type_arity_mismatch of Ocaml_parsing.Longident.t * int * int
  5. | Bound_type_variable of string
  6. | Recursive_type
  7. | Type_mismatch of Errortrace.unification_error
  8. | Alias_type_mismatch of Errortrace.unification_error
  9. | Present_has_conjunction of string
  10. | Present_has_no_type of string
  11. | Constructor_mismatch of Types.type_expr * Types.type_expr
  12. | Not_a_variant of Types.type_expr
  13. | Variant_tags of string * string
  14. | Invalid_variable_name of string
  15. | Cannot_quantify of string * cannot_quantify_reason
  16. | Bad_univar_jkind of {
    1. name : string;
    2. jkind_info : jkind_info;
    3. inferred_jkind : Types.jkind_lr;
    }
  17. | Multiple_constraints_on_type of Ocaml_parsing.Longident.t
  18. | Method_mismatch of string * Types.type_expr * Types.type_expr
  19. | Opened_object of Path.t option
  20. | Not_an_object of Types.type_expr
  21. | Unsupported_extension : _ Ocaml_parsing.Language_extension.t -> error
  22. | Polymorphic_optional_param
  23. | Non_value of {
    1. vloc : value_loc;
    2. typ : Types.type_expr;
    3. err : Jkind.Violation.t;
    }
  24. | Non_sort of {
    1. vloc : sort_loc;
    2. typ : Types.type_expr;
    3. err : Jkind.Violation.t;
    }
  25. | Bad_jkind_annot of Types.type_expr * Jkind.Violation.t
  26. | Did_you_mean_unboxed of Ocaml_parsing.Longident.t
  27. | Invalid_label_for_call_pos of Ocaml_parsing.Parsetree.arg_label
  28. | Invalid_variable_stage of {
    1. name : string;
    2. intro_stage : Env.stage;
    3. usage_stage : Env.stage;
    }
exception Error of Ocaml_parsing.Location.t * Env.t * error
val report_error : Env.t -> Format.formatter -> error -> unit
val transl_modtype_longident : (Ocaml_parsing.Location.t -> Env.t -> Ocaml_parsing.Longident.t -> Path.t) ref