[][src]Enum gluon_check::typecheck::TypeError

pub enum TypeError<I, T> {
    UndefinedVariable(I),
    NotAFunction(T),
    UndefinedType(I),
    UndefinedField(T, I),
    PatternError(T, usize),
    Unification(T, T, Vec<UnifyTypeError<I, T>>),
    KindError(KindCheckError<I, T>),
    RecursionCheck(Error),
    DuplicateTypeDefinition(I),
    DuplicateField(I),
    InvalidProjection(T),
    UndefinedRecord {
        fields: Vec<I>,
    },
    EmptyCase,
    Message(String),
    UnableToResolveImplicit(Error<T>),
}

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(T, usize)

Constructor type was found in a pattern but did not have the expected number of arguments

Unification(T, T, Vec<UnifyTypeError<I, T>>)

Errors found when trying to unify two types

KindError(KindCheckError<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

Fields of UndefinedRecord

fields: Vec<I>
EmptyCase

Found a case expression without any alternatives

Message(String)UnableToResolveImplicit(Error<T>)

Methods

impl<I, T> TypeError<I, T>[src]

pub fn map_t<RET>(self, __f: &mut impl FnMut(T) -> RET) -> TypeError<I, RET> where
    T: Clone
[src]

Trait Implementations

impl<I: PartialEq, T: PartialEq> PartialEq<TypeError<I, T>> for TypeError<I, T>[src]

impl<I, T> From<Error<KindError<I, T>, ArcKind>> for TypeError<I, T>[src]

impl<I, T> From<Error<T>> for TypeError<I, T>[src]

impl<I, T> Display for TypeError<I, T> where
    I: Display + AsRef<str> + Clone,
    T: TypeExt<Id = I> + Display + Commented + HasSpan + for<'a> ToDoc<'a, Arena<'a, ()>, (), ()>, 
[src]

impl<I: Debug, T: Debug> Debug for TypeError<I, T>[src]

impl<I, T> AsDiagnostic for TypeError<I, T> where
    I: Display + AsRef<str> + Clone,
    T: TypeExt<Id = I> + Display + Commented + HasSpan + for<'a> ToDoc<'a, Arena<'a, ()>, (), ()>, 
[src]

Auto Trait Implementations

impl<I, T> Send for TypeError<I, T> where
    I: Send,
    T: Send + Sync

impl<I, T> Sync for TypeError<I, T> where
    I: Sync,
    T: Send + Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]