type position =
| First
| Second
type desc = {
t : Types.type_expr;
expanded : Types.type_expr option;
}
type 'a diff = {
got : 'a;
expected : 'a;
}
type 'a escape =
| Constructor of Path.t
| Univ of Types.type_expr
The type_expr argument of
Univ
is always aTunivar _
, we keep atype_expr
to track renaming inPrinttyp
| Self
| Module_type of Path.t
| Equation of 'a
Scope escape related errors
type variant =
| No_intersection
| No_tags of position * (Asttypes.label * Types.row_field) list
| Incompatible_types_for of string
Errors for polymorphic variants
type obj =
| Missing_field of position * string
| Abstract_row of position
| Self_cannot_be_closed
type 'a elt =
| Diff of 'a diff
| Variant of variant
| Obj of obj
| Escape of {
context : Types.type_expr option;
kind : 'a escape;
}
| Incompatible_fields of {
name : string;
diff : Types.type_expr diff;
}
| Rec_occur of Types.type_expr * Types.type_expr
type t = desc elt list
val diff : Types.type_expr -> Types.type_expr -> desc elt
val map_diff : ('a -> 'b) -> 'a diff -> 'b diff
map_diff f {expected;got}
is{expected=f expected; got=f got}
val flatten : (Types.type_expr -> Types.type_expr -> 'a) -> t -> 'a elt list
flatten f trace
flattens all elements of typedesc
intrace
to eitherf x.t expanded
ifx.expanded=Some expanded
orf x.t x.t
otherwise