Mlsem_system.ErrorTyping errors, as reported by Checker and Reconstruction.
An error only records the data that explains the failure; its textual rendering is left to the client, pp being a default printer.
type kind = | UnboundVar of Mlsem_common.Variable.t| UntypeableApp of {fn : Mlsem_types.Ty.t;arg : Mlsem_types.Ty.t;}No instance of the function type accepts the argument type.
*)| UntypeableConstructor of {expected : Mlsem_types.GTy.t list list;given : Mlsem_types.GTy.t list;}The arguments do not fit any of the domains of the constructor (each domain being a list with one type per argument).
*)| UntypeableRec of {funs : Mlsem_common.Variable.t list;expected : Mlsem_types.Ty.t list;given : Mlsem_types.Ty.t list;}The bodies of the mutually recursive functions funs cannot be unified with their own types: the body types given must be subtypes of the types expected annotated for the functions (one per function, in order).
| UntypeableEncodingNone of the alternatives of an encoding is typeable.
*)| UntypeableProjection of {arg : Mlsem_types.Ty.t;domain : Mlsem_types.Ty.t;}| UntypeableCast of {check : Ast.check;expected : Mlsem_types.GTy.t;given : Mlsem_types.GTy.t;}| UntypeableCoercion of {check : Ast.check;expected : Mlsem_types.GTy.t;given : Mlsem_types.GTy.t;}| InvalidAnnot of stringThe annotation given to Checker is not a valid derivation. In normal operation the reconstruction only produces valid annotations, so this error indicates an internal inconsistency rather than a user type error — user errors are reported by the reconstruction.
type t = {eid : Mlsem_common.Eid.t;The identifier of the expression on which the error occurred
*)expr : Ast.e;The expression on which the error occurred
*)kind : kind;env : Mlsem_common.Env.t;The typing environment at that expression
*)ann : Annot.IAnnot.a;The (partial) annotation of that expression
*)}exception Untypeable of tRaised by Checker and Reconstruction when an expression is untypeable.
val title : t -> stringA short, one-line summary of the error (e.g. "untypeable application").
type style = | TypesPrint the types involved (e.g. the function and argument types).
*)| WitnessesPrint a witness of the failure: a value that is in the given type but not in the expected one (e.g. an argument outside the domain of the function). Falls back to Types when no such value exists (e.g. when the failure comes from polymorphism rather than from a plain subtyping mismatch).
| BothPrint the types, followed by a witness if there is one.
*)Prints the details of the error, according to style (default Types). Prints nothing if there are no details.