Module Ocaml_typing.Typedecl

type transl_value_decl_modal =
  1. | Str_primitive
    (*

    A primitive in structure, in which case the modality syntax is treated as modes, and the returned value description will have empty modalities.

    *)
  2. | Sig_value of Mode.Value.l * Mode.Modality.Const.t
    (*

    A value description in a signature, in which case we require the mode of the structure that the value lives in, as well as the default modalities of the signature.

    *)

Returns a value description and the mode that the VD is based on, and a new environment that contains the VD at the mode.

val transl_with_constraint : Ident.t -> ?fixed_row_path:Path.t -> sig_env:Env.t -> sig_decl:Types.type_declaration -> outer_env:Env.t -> Ocaml_parsing.Parsetree.type_declaration -> Typedtree.type_declaration
val transl_package_constraint : loc:Ocaml_parsing.Location.t -> Types.type_expr -> Types.type_declaration
val abstract_type_decl : injective:bool -> jkind:Types.jkind_l -> params:Types.jkind_lr list -> Types.type_declaration
val check_recmod_typedecl : Env.t -> Ocaml_parsing.Location.t -> Ident.t list -> Path.t -> Types.type_declaration -> unit
val check_coherence : Env.t -> Ocaml_parsing.Location.t -> Path.t -> Types.type_declaration -> unit
val is_fixed_type : Ocaml_parsing.Parsetree.type_declaration -> bool
val mixed_block_element : Env.t -> Types.type_expr -> _ Types.jkind -> Types.mixed_block_element
type native_repr_kind =
  1. | Unboxed
  2. | Untagged
type jkind_sort_loc =
  1. | Cstr_tuple of {
    1. unboxed : bool;
    }
  2. | Record of {
    1. unboxed : bool;
    }
  3. | Record_unboxed_product
  4. | Inlined_record of {
    1. unboxed : bool;
    }
  5. | Mixed_product
  6. | External
  7. | External_with_layout_poly
type reaching_type_path = reaching_type_step list
and reaching_type_step =
  1. | Expands_to of Types.type_expr * Types.type_expr
  2. | Contains of Types.type_expr * Types.type_expr
module Mixed_product_kind : sig ... end
val assert_mixed_product_support : Ocaml_utils.Warnings.loc -> Mixed_product_kind.t -> value_prefix_len:int -> unit
type mixed_product_violation =
  1. | Runtime_support_not_enabled of Mixed_product_kind.t
  2. | Extension_constructor
  3. | Value_prefix_too_long of {
    1. value_prefix_len : int;
    2. max_value_prefix_len : int;
    3. mixed_product_kind : Mixed_product_kind.t;
    }
  4. | Insufficient_level of {
    1. required_layouts_level : Ocaml_parsing.Language_extension.maturity;
    2. mixed_product_kind : Mixed_product_kind.t;
    }
type bad_jkind_inference_location =
  1. | Check_constraints
  2. | Delayed_checks
type error =
  1. | Repeated_parameter
  2. | Duplicate_constructor of string
  3. | Too_many_constructors
  4. | Duplicate_label of string
  5. | Unboxed_mutable_label
  6. | Recursive_abbrev of string * Env.t * reaching_type_path
  7. | Cycle_in_def of string * Env.t * reaching_type_path
  8. | Unboxed_recursion of string * Env.t * reaching_type_path
  9. | Definition_mismatch of Types.type_expr * Env.t * Includecore.type_mismatch option
  10. | Constraint_failed of Env.t * Errortrace.unification_error
  11. | Inconsistent_constraint of Env.t * Errortrace.unification_error
  12. | Type_clash of Env.t * Errortrace.unification_error
  13. | Non_regular of {
    1. definition : Path.t;
    2. used_as : Types.type_expr;
    3. defined_as : Types.type_expr;
    4. reaching_path : reaching_type_path;
    }
  14. | Null_arity_external
  15. | Missing_native_external
  16. | Unbound_type_var of Types.type_expr * Types.type_declaration
  17. | Cannot_extend_private_type of Path.t
  18. | Not_extensible_type of Path.t
  19. | Extension_mismatch of Path.t * Env.t * Includecore.type_mismatch
  20. | Rebind_wrong_type of Ocaml_parsing.Longident.t * Env.t * Errortrace.unification_error
  21. | Rebind_mismatch of Ocaml_parsing.Longident.t * Path.t * Path.t
  22. | Rebind_private of Ocaml_parsing.Longident.t
  23. | Variance of Typedecl_variance.error
  24. | Unavailable_type_constructor of Path.t
  25. | Unbound_type_var_ext of Types.type_expr * Types.extension_constructor
  26. | Val_in_structure
  27. | Multiple_native_repr_attributes
  28. | Cannot_unbox_or_untag_type of native_repr_kind
  29. | Deep_unbox_or_untag_attribute of native_repr_kind
  30. | Jkind_mismatch_of_type of Types.type_expr * Jkind.Violation.t
  31. | Jkind_mismatch_of_path of Path.t * Jkind.Violation.t
  32. | Jkind_mismatch_due_to_bad_inference of Types.type_expr * Jkind.Violation.t * bad_jkind_inference_location
  33. | Jkind_sort of {
    1. kloc : jkind_sort_loc;
    2. typ : Types.type_expr;
    3. err : Jkind.Violation.t;
    }
  34. | Jkind_empty_record
  35. | Non_representable_in_module of Jkind.Violation.t * Types.type_expr
  36. | Invalid_jkind_in_block of Types.type_expr * Jkind.Sort.Const.t * jkind_sort_loc
  37. | Illegal_mixed_product of mixed_product_violation
  38. | Separability of Typedecl_separability.error
  39. | Bad_unboxed_attribute of string
  40. | Boxed_and_unboxed
  41. | Nonrec_gadt
  42. | Invalid_private_row_declaration of Types.type_expr
  43. | Local_not_enabled
  44. | Unexpected_layout_any_in_primitive of string
  45. | Useless_layout_poly
  46. | Zero_alloc_attr_unsupported of Ocaml_parsing.Builtin_attributes.zero_alloc_attribute
  47. | Zero_alloc_attr_non_function
  48. | Zero_alloc_attr_bad_user_arity
  49. | Invalid_reexport of {
    1. definition : Path.t;
    2. expected : Path.t;
    }
  50. | Non_abstract_reexport of Path.t
  51. | Unsafe_mode_crossing_on_invalid_type_kind
  52. | Illegal_baggage of Types.jkind_l
  53. | No_unboxed_version of Path.t
  54. | Atomic_field_must_be_mutable of string
  55. | Constructor_submode_failed of Mode.Value.error
  56. | Atomic_field_in_mixed_block
  57. | Non_value_atomic_field
exception Error of Ocaml_parsing.Location.t * error
val report_error : Format.formatter -> error -> unit