Enum gluon_check::typecheck::TypeError
source · pub enum TypeError<I, T> {
Show 16 variants
UndefinedVariable(I),
NotAFunction(T),
UndefinedType(I),
UndefinedField(T, I),
PatternError {
constructor_type: T,
pattern_args: usize,
},
Unification(T, T, Vec<Error<I, T>>),
KindError(Error<I, T>),
RecursionCheck(Error),
DuplicateTypeDefinition(I),
DuplicateField(I),
InvalidProjection(T),
UndefinedRecord {
fields: Vec<I>,
},
EmptyCase,
Message(String),
UnableToResolveImplicit(Error<T>),
TypeConstructorReturnsWrongType {
expected: I,
actual: T,
},
}
Expand description
Type representing a single error when checking a type
Variants§
UndefinedVariable(I)
Variable has not been defined before it was used
NotAFunction(T)
Attempt to call a type which is not a function
UndefinedType(I)
Type has not been defined before it was used
UndefinedField(T, I)
Type were expected to have a certain field
PatternError
Constructor type was found in a pattern but did not have the expected number of arguments
Unification(T, T, Vec<Error<I, T>>)
Errors found when trying to unify two types
KindError(Error<I, T>)
Error were found when trying to unify the kinds of two types
RecursionCheck(Error)
Error were found when checking value recursion
DuplicateTypeDefinition(I)
Multiple types were declared with the same name in the same expression
DuplicateField(I)
A field was defined more than once in a record constructor or pattern match
InvalidProjection(T)
Type is not a type which has any fields
UndefinedRecord
Expected to find a record with the following fields
EmptyCase
Found a case expression without any alternatives