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
| ExpectedPermission of TypeCore.typ * 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 ExpressionsCore.pattern * TypeCore.Field.name
| BadPattern of ExpressionsCore.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 ExpressionsCore.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
| NoSuchTypeInSignature of TypeCore.var * TypeCore.typ * Derivations.derivation
| DataTypeMismatchInSignature of Variable.name * string
| VarianceAnnotationMismatch
| ExportNotDuplicable of Variable.name
| LocalType
| Instantiated of Variable.name * TypeCore.typ
| PackWithExists
| SeveralWorkingFunctionTypes of TypeCore.var
Clients of this module will want to use the various errors offered.
val parse_warn_error : string -> unit
Set up the module to take into account the warn / error / silent settings specified on the command-line.
val raise_error : TypeCore.env -> raw_error -> 'a
This function raises an exception that will be later on catched in Driver.
val may_raise_error : TypeCore.env -> raw_error -> unit
This function may raise an exception that will be later on catched in Driver, or emit a warning, or do nothing, depending on whether the error has been tweaked with the warn/error string.
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.