Module TypeErrors

module TypeErrors: sig .. end
Everything you ever dreamed of for reporting errors.

type raw_error = 
| CyclicDependency of Module.name
| NotAFunction of TypeCore.var
| ExpectedType of TypeCore.typ * TypeCore.var * Derivations.derivation
| RecursiveOnlyForFunctions
| MissingField of TypeCore.Field.name
| ExtraField of TypeCore.Field.name
| NoSuchField of TypeCore.var * TypeCore.Field.name
| CantAssignTag of TypeCore.var
| NoSuchFieldInPattern of Expressions.pattern * TypeCore.Field.name
| BadPattern of Expressions.pattern * TypeCore.var
| BadField of Datacon.name * TypeCore.Field.name
| NoTwoConstructors of TypeCore.var
| MatchBadDatacon of TypeCore.var * Datacon.name
| MatchBadTuple of TypeCore.var
| AssignNotExclusive of TypeCore.typ * Datacon.name
| FieldCountMismatch of TypeCore.typ * Datacon.name
| NoMultipleArguments
| ResourceAllocationConflict of TypeCore.var
| UncertainMerge of TypeCore.var
| ConflictingTypeAnnotations of TypeCore.typ * TypeCore.typ
| IllKindedTypeApplication of Expressions.tapp * Kind.kind * Kind.kind
| BadTypeApplication of TypeCore.var
| NonExclusiveAdoptee of TypeCore.typ
| NoAdoptsClause of TypeCore.var
| NotDynamic of TypeCore.var
| NoSuitableTypeForAdopts of TypeCore.var * TypeCore.typ
| AdoptsNoAnnotation
| NotMergingClauses of TypeCore.env * TypeCore.typ * TypeCore.typ * TypeCore.env * TypeCore.typ
* TypeCore.typ
| MissingFieldInSignature of Variable.name
| NoSuchTypeInSignature of TypeCore.var * TypeCore.typ
| DataTypeMismatchInSignature of Variable.name * string
| VarianceAnnotationMismatch
Clients of this module will want to use the various errors offered.
val raise_error : TypeCore.env -> raw_error -> 'a
This function raises an exception that will be later on catched in Driver.
val warn_or_error : TypeCore.env -> raw_error -> unit
This function will emit a warning or potentially raise an error, depending on the runtime flags.
type error 
A TypeErrors.raw_error is wrapped.
exception TypeCheckerError of error
And this is the exception that you can catch.
val print_error : Buffer.t -> error -> unit
Once an exception is catched, it can be printed with Log.error and %a...
val html_error : error -> unit
... or displayed as an HTML error.
val fold_type : TypeCore.env -> TypeCore.typ -> TypeCore.typ option
This is only for display purposes.