module MiniTypingExceptions: sig
.. end
This modules declares the exceptions raised by the type inference engine.
exception UnboundTypeIdentifier of Positions.position * MultiEquation.tname
UnboundTypeIdentifier
is raised when an unbound type identifier
is found.
exception InvalidTypeVariableIdentifier of Positions.position * MultiEquation.tname
InvalidTypeVariableIdentifier
is raised when a type variable is
overwriting a type constructor.
exception UnboundDataConstructor of Positions.position * MiniAst.dname
UnboundDataConstructor
is raised when a constructor identifier is
used although it has not been defined.
exception InvalidDataConstructorDefinition of Positions.position * MiniAst.dname
InvalidDataConstructorDefinition
is raised when the declared
type scheme of a data constructor is not regular.
exception UnboundTypeVariable of Positions.position * MultiEquation.tname
UnboundTypeVariable
is raised when a variable identifier is
used although it has not been defined.
exception MultipleLabels of Positions.position * CoreAlgebra.lname
MultipleLabels
is raised when the user has built a record
with two fields with the same name.
exception NonLinearPattern of Positions.position * MiniAst.name
NonLinearPattern
is raised when at least two occurrences of a variable
appear in a pattern.
exception InvalidDisjunctionPattern of Positions.position
InvalidDisjunctionPattern
is raised when the subpatterns of a
disjunction pattern do not bind the same variables.
exception NotEnoughPatternArgts of Positions.position
NotEnoughPatternArgts
is raised when the arity of a data constructor
is not respected in a pattern.
exception InvalidNumberOfTypeVariable of Positions.position
InvalidNumberOfTypeVariable
is raised when the introduction of
existential type variables in a pattern is not well-formed.
exception RecursiveDefMustBeVariable of Positions.position
RecursiveDefMustBeVariable
is raised in case of bad formed
recursive value definition.
exception CannotGeneralize of Positions.position * MultiEquation.crterm
CannotGeneralize
when the type of an expression cannot be
generalized contrary to what is specified by the programmers
using type annotations.
exception NonDistinctVariables of Positions.position * MultiEquation.variable list
NonDistinctVariables
is raised when two rigid type variables have
been unified.
exception CannotUnifyHeadWithTerm of Positions.position * MultiEquation.tname * MultiEquation.crterm
CannotUnifyHeadWithTerm
is raised when we encounter first order
unification error.
exception NonExhaustiveMatch of Positions.position * MiniAst.pattern
This exception is raised when a match is not complete.
exception UnboundTypeConstructor of Positions.position * MultiEquation.tname
UnboundConstructor
is raised when a type constructor is unbound.
exception KindError of Positions.position
KindError
is raised when the kind of types are not correct.
exception PartialDataConstructorApplication of Positions.position * int * int
PartialDataConstructorApplication
is raised when a data constructor's
arity is not respected by the programmer.