Module Typecore
type type_forcing_context = | If_conditional| If_no_else_branch| While_loop_conditional| While_loop_body| For_loop_start_index| For_loop_stop_index| For_loop_body| Assert_condition| Sequence_left_hand_side| When_guard| Comprehension_in_iterator of Typecore.comprehension_type| Comprehension_for_start| Comprehension_for_stop| Comprehension_when| Error_message_attr of string
type type_expected = private {ty : Types.type_expr;explanation : Typecore.type_forcing_context option;
}type pattern_variable = {pv_id : Ident.t;pv_uid : Types.Uid.t;pv_mode : Mode.Value.l;pv_kind : Types.value_kind;pv_type : Types.type_expr;pv_loc : Location.t;pv_as_var : bool;pv_attributes : Typedtree.attributes;pv_sort : Jkind.Sort.t;
}val mk_expected :
?explanation:Typecore.type_forcing_context ->
Types.type_expr ->
Typecore.type_expectedval is_nonexpansive : Typedtree.expression -> boolmodule Datatype_kind : sig ... endtype wrong_name = {type_path : Path.t;kind : Typecore.Datatype_kind.t;name : string Asttypes.loc;valid_names : string list;
}type existential_restriction = | At_toplevel(*no existential types at the toplevel
*)| In_group(*nor with
*)let ... and ...| In_rec(*or recursive definition
*)| With_attributes(*or
*)let[@any_attribute] = ...| In_class_args(*or in class arguments
*)class c (...) = ...| In_class_def(*or in
*)class c = let ... in ...| In_self_pattern(*or in self pattern
*)
val type_binding :
Env.t ->
Asttypes.mutable_flag ->
Asttypes.rec_flag ->
?force_toplevel:bool ->
Parsetree.value_binding list ->
Typedtree.value_binding list * Env.tval type_let :
Typecore.existential_restriction ->
Env.t ->
Asttypes.mutable_flag ->
Asttypes.rec_flag ->
Parsetree.value_binding list ->
Typedtree.value_binding list * Env.tval type_expression : Env.t -> Parsetree.expression -> Typedtree.expressionval type_representable_expression :
why:Jkind.History.concrete_creation_reason ->
Env.t ->
Parsetree.expression ->
Typedtree.expression * Jkind.sortval type_class_arg_pattern :
string ->
Env.t ->
Env.t ->
Types.arg_label ->
Parsetree.pattern ->
Typedtree.pattern
* (Ident.t * Ident.t * Types.type_expr) list
* Env.t
* Env.tval type_self_pattern :
Env.t ->
Parsetree.pattern ->
Typedtree.pattern * Typecore.pattern_variable listval check_partial :
?lev:int ->
Env.t ->
Types.type_expr ->
Location.t ->
Typedtree.value Typedtree.case list ->
Typedtree.partialval type_expect :
Env.t ->
?mode:Mode.Value.r ->
Parsetree.expression ->
Typecore.type_expected ->
Typedtree.expressionval type_exp :
Env.t ->
?mode:Mode.Value.r ->
Parsetree.expression ->
Typedtree.expressionval type_approx : Env.t -> Parsetree.expression -> Types.type_expr -> unitval type_argument :
Env.t ->
Parsetree.expression ->
Types.type_expr ->
Types.type_expr ->
Typedtree.expressionval type_option_some :
Env.t ->
Parsetree.expression ->
Types.type_expr ->
Types.type_expr ->
Typedtree.expressionval type_option_none :
Env.t ->
Types.type_expr ->
Location.t ->
Typedtree.expressionval generalizable : int -> Types.type_expr -> boolval generalize_structure_exp : Typedtree.expression -> unitval has_poly_constraint : Parsetree.pattern -> boolval name_pattern : string -> Typedtree.pattern list -> Ident.t * Types.Uid.tval name_cases :
string ->
Typedtree.value Typedtree.case list ->
Ident.t * Types.Uid.tval escape :
loc:Location.t ->
env:Env.t ->
reason:Typecore.submode_reason ->
(Mode.allowed * 'r) Mode.Value.t ->
unitval self_coercion : (Path.t * Location.t list Stdlib.ref) list Stdlib.reftype error = | Constructor_arity_mismatch of Longident.t * int * int| Constructor_labeled_arg| Partial_tuple_pattern_bad_type| Extra_tuple_label of string option * Types.type_expr| Missing_tuple_label of string option * Types.type_expr| Label_mismatch of Types.record_form_packed * Longident.t * Errortrace.unification_error| Pattern_type_clash : Errortrace.unification_error * Parsetree.pattern_desc option -> Typecore.error| Or_pattern_type_clash of Ident.t * Errortrace.unification_error| Multiply_bound_variable of string| Orpat_vars of Ident.t * Ident.t list| Expr_type_clash of Errortrace.unification_error * Typecore.type_forcing_context option * Parsetree.expression_desc option| Function_arity_type_clash of {syntactic_arity : int;type_constraint : Types.type_expr;trace : Errortrace.unification_error;
}| Apply_non_function of {funct : Typedtree.expression;func_ty : Types.type_expr;res_ty : Types.type_expr;previous_arg_loc : Location.t;extra_arg_loc : Location.t;
}| Apply_wrong_label of Types.arg_label * Types.type_expr * bool| Label_multiply_defined of string| Label_missing of Types.record_form_packed * Ident.t list| Label_not_mutable of Longident.t| Wrong_name of string * Typecore.type_expected * Typecore.wrong_name| Name_type_mismatch of Typecore.Datatype_kind.t * Longident.t * Path.t * Path.t * (Path.t * Path.t) list| Invalid_format of string| Not_an_object of Types.type_expr * Typecore.type_forcing_context option| Non_value_object of Jkind.Violation.t * Typecore.type_forcing_context option| Non_value_let_rec of Jkind.Violation.t * Types.type_expr| Undefined_method of Types.type_expr * string * string list option| Undefined_self_method of string * string list| Virtual_class of Longident.t| Private_type of Types.type_expr| Private_label of Longident.t * Types.type_expr| Private_constructor of Types.constructor_description * Types.type_expr| Unbound_instance_variable of string * string list| Instance_variable_not_mutable of string| Not_subtype of Errortrace.Subtype.error| Outside_class| Value_multiply_overridden of string| Coercion_failure of Errortrace.expanded_type * Errortrace.unification_error * bool| Not_a_function of Types.type_expr * Typecore.type_forcing_context option| Too_many_arguments of Types.type_expr * Typecore.type_forcing_context option| Abstract_wrong_label of {got : Types.arg_label;expected : Types.arg_label;expected_type : Types.type_expr;explanation : Typecore.type_forcing_context option;
}| Scoping_let_module of string * Types.type_expr| Not_a_polymorphic_variant_type of Longident.t| Incoherent_label_order| Less_general of string * Errortrace.unification_error| Modules_not_allowed| Cannot_infer_signature| Not_a_packed_module of Types.type_expr| Unexpected_existential of Typecore.existential_restriction * string| Unexpected_mutable of Typecore.mutable_restriction| Invalid_interval| Invalid_for_loop_index| Invalid_comprehension_for_range_iterator_index| No_value_clauses| Exception_pattern_disallowed| Mixed_value_and_exception_patterns_under_guard| Inlined_record_escape| Inlined_record_expected| Unrefuted_pattern of Typedtree.pattern| Invalid_extension_constructor_payload| Not_an_extension_constructor| Probe_format| Probe_name_format of string| Probe_name_undefined of string| Probe_is_enabled_format| Extension_not_enabled : _ Language_extension.t -> Typecore.error| Atomic_in_pattern of Longident.t| Invalid_atomic_loc_payload| Label_not_atomic of Longident.t| Modalities_on_atomic_field of Longident.t| Literal_overflow of string| Unknown_literal of string * char| Float32_literal of string| Int8_literal of string| Int16_literal of string| Untagged_char_literal of char| Illegal_letrec_pat| Illegal_letrec_expr| Illegal_mutable_pat| Illegal_class_expr| Letop_type_clash of string * Errortrace.unification_error| Andop_type_clash of string * Errortrace.unification_error| Bindings_type_clash of Errortrace.unification_error| Unbound_existential of Ident.t list * Types.type_expr| Missing_type_constraint| Wrong_expected_kind of Typecore.wrong_kind_sort * Typecore.wrong_kind_context * Types.type_expr| Wrong_expected_record_boxing of Typecore.wrong_kind_context * Types.record_form_packed * Types.type_expr| Expr_not_a_record_type of Types.record_form_packed * Types.type_expr| Expr_record_type_has_wrong_boxing of Types.record_form_packed * Types.type_expr| Invalid_unboxed_access of {prev_el_type : Types.type_expr;ua : Parsetree.unboxed_access;
}| Block_access_record_unboxed| Block_access_private_record| Block_index_flattened_record of Types.type_expr| Block_index_modality_mismatch of {mut : bool;err : Mode.Modality.equate_error;
}| Block_index_atomic_unsupported| Submode_failed of Mode.Value.error * Typecore.submode_reason| Curried_application_complete of Types.arg_label * Mode.Alloc.error * [ `Prefix | `Single_arg | `Entire_apply ]| Param_mode_mismatch of Mode.Alloc.equate_error| Uncurried_function_escapes of Mode.Alloc.error| Function_returns_local| Tail_call_local_returning| Bad_tail_annotation of [ `Conflict | `Not_a_tailcall ]| Optional_poly_param| Exclave_in_nontail_position| Exclave_returns_not_local| Unboxed_int_literals_not_supported| Function_type_not_rep of Types.type_expr * Jkind.Violation.t| Record_projection_not_rep of Types.type_expr * Jkind.Violation.t| Record_not_rep of Types.type_expr * Jkind.Violation.t| Mutable_var_not_rep of Types.type_expr * Jkind.Violation.t| Invalid_label_for_src_pos of Types.arg_label| Nonoptional_call_pos_label of string| Unsupported_stack_allocation of Typecore.unsupported_stack_allocation| Not_allocation| Impossible_function_jkind of {some_args_ok : bool;ty_fun : Types.type_expr;jkind : Types.jkind_lr;
}| Overwrite_of_invalid_term| Unexpected_hole| Eval_format
exception Error of Location.t * Env.t * Typecore.errorexception Error_forward of Location.errorval report_error : loc:Location.t -> Env.t -> Typecore.error -> Location.errorval type_module :
(Env.t ->
Parsetree.module_expr ->
Typedtree.module_expr * Shape.t)
Stdlib.refval type_open :
(?used_slot:bool Stdlib.ref ->
Asttypes.override_flag ->
Env.t ->
Location.t ->
Longident.t Asttypes.loc ->
Path.t * Env.t)
Stdlib.refval type_open_decl :
(?used_slot:bool Stdlib.ref ->
Env.t ->
Parsetree.open_declaration ->
Typedtree.open_declaration * Env.t)
Stdlib.refval type_object :
(Env.t ->
Location.t ->
Parsetree.class_structure ->
Typedtree.class_structure * string list)
Stdlib.refval type_package :
(Env.t ->
Parsetree.module_expr ->
Path.t ->
(Longident.t * Types.type_expr) list ->
Typedtree.module_expr * (Longident.t * Types.type_expr) list)
Stdlib.refval constant :
Parsetree.constant ->
(Typedtree.constant, Typecore.error) Stdlib.resultval annotate_recursive_bindings :
Env.t ->
Typedtree.value_binding list ->
Typedtree.value_binding listval check_recursive_class_bindings :
Env.t ->
Ident.t list ->
Typedtree.class_expr list ->
unitval src_pos :
Location.t ->
Typedtree.attributes ->
Env.t ->
Typedtree.expression