Module Errortrace
val swap_position : Errortrace.position -> Errortrace.positionval print_pos : Stdlib.Format.formatter -> Errortrace.position -> unitval trivial_expansion : Types.type_expr -> Errortrace.expanded_typetrivial_expansion ty creates an expanded_type whose expansion is also ty. Usually, you want Ctype.expand_type instead, since the expansion carries useful information; however, in certain circumstances, the error is about the expansion of the type, meaning that actually performing the expansion produces more confusing or inaccurate output.
val map_diff : ('a -> 'b) -> 'a Errortrace.diff -> 'b Errortrace.diffmap_diff f {expected;got} is {expected=f expected; got=f got}
type 'a escape_kind = | Constructor of Path.t| Univ of Types.type_expr| Self| Module_type of Path.t| Equation of 'a| Constraint
Scope escape related errors
val map_escape : ('a -> 'b) -> 'a Errortrace.escape -> 'b Errortrace.escapetype 'variety variant = | Incompatible_types_for : string -> _ Errortrace.variant| No_intersection : Errortrace.unification Errortrace.variant| Fixed_row : Errortrace.position * Errortrace.fixed_row_case * Types.fixed_explanation -> Errortrace.unification Errortrace.variant| Presence_not_guaranteed_for : Errortrace.position * string -> Errortrace.comparison Errortrace.variant| Openness : Errortrace.position -> Errortrace.comparison Errortrace.variant
type 'variety obj = | Missing_field : Errortrace.position * string -> _ Errortrace.obj| Abstract_row : Errortrace.position -> _ Errortrace.obj| Self_cannot_be_closed : Errortrace.unification Errortrace.obj
type ('a, 'variety) elt = | Diff : 'a Errortrace.diff -> ('a, _) Errortrace.elt| Variant : 'variety Errortrace.variant -> ('a, 'variety) Errortrace.elt| Obj : 'variety Errortrace.obj -> ('a, 'variety) Errortrace.elt| Escape : 'a Errortrace.escape -> ('a, _) Errortrace.elt| Incompatible_fields : {name : string;diff : Types.type_expr Errortrace.diff;
} -> ('a, _) Errortrace.elt| Rec_occur : Types.type_expr * Types.type_expr -> ('a, _) Errortrace.elt| Bad_jkind : Types.type_expr * Jkind.Violation.t -> ('a, _) Errortrace.elt| Bad_jkind_sort : Types.type_expr * Jkind.Violation.t -> ('a, _) Errortrace.elt| Unequal_var_jkinds : Types.type_expr * Types.jkind_lr * Types.type_expr * Types.jkind_lr -> ('a, _) Errortrace.elt| Unequal_tof_kind_jkinds : Types.jkind_lr * Types.jkind_lr -> ('a, _) Errortrace.elt
type ('a, 'variety) t = ('a, 'variety) Errortrace.elt listtype 'variety trace = (Types.type_expr, 'variety) Errortrace.ttype 'variety error = (Errortrace.expanded_type, 'variety) Errortrace.tval map :
('a -> 'b) ->
('a, 'variety) Errortrace.t ->
('b, 'variety) Errortrace.tval incompatible_fields :
name:string ->
got:Types.type_expr ->
expected:Types.type_expr ->
(Types.type_expr, _) Errortrace.eltval swap_trace : ('a, 'variety) Errortrace.t -> ('a, 'variety) Errortrace.tThe traces ('variety t) are the core error types. However, we bundle them up into three "top-level" error types, which are used elsewhere: unification_error, equality_error, and moregen_error. In the case of equality_error, this has to bundle in extra information; in general, it distinguishes the three types of errors and allows us to distinguish traces that are being built (or processed) from those that are complete and have become the final error. These error types have the invariants that their traces are nonempty; we ensure that through three smart constructors with matching names.
type equality_error = private {trace : Errortrace.comparison Errortrace.error;subst : (Types.type_expr * Types.type_expr) list;
}val unification_error :
trace:Errortrace.unification Errortrace.error ->
Errortrace.unification_errorval equality_error :
trace:Errortrace.comparison Errortrace.error ->
subst:(Types.type_expr * Types.type_expr) list ->
Errortrace.equality_errorval moregen_error :
trace:Errortrace.comparison Errortrace.error ->
Errortrace.moregen_errortype comparison_error = | Equality_error of Errortrace.equality_error| Moregen_error of Errortrace.moregen_error
Wraps up the two different kinds of comparison errors in one type
val swap_unification_error :
Errortrace.unification_error ->
Errortrace.unification_errorLift swap_trace to unification_error
module Subtype : sig ... end