pub enum TypeError {
Mismatch {
expected: InferType,
found: InferType,
},
InfiniteType {
var: TyVar,
ty: InferType,
},
ArityMismatch {
expected: usize,
found: usize,
},
FieldNotFound {
type_name: Symbol,
field_name: Symbol,
},
NotAFunction {
found: InferType,
},
}Expand description
A type error detected during unification or checking.
Variants§
Implementations§
Source§impl TypeError
impl TypeError
pub fn expected_str(&self) -> String
pub fn found_str(&self) -> String
Sourcepub fn to_parse_error_kind(&self, interner: &Interner) -> ParseErrorKind
pub fn to_parse_error_kind(&self, interner: &Interner) -> ParseErrorKind
Convert this TypeError into a ParseErrorKind for user-facing reporting.
Uses interner to resolve symbol names (field names, type names) into strings.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeError
impl RefUnwindSafe for TypeError
impl Send for TypeError
impl Sync for TypeError
impl Unpin for TypeError
impl UnsafeUnpin for TypeError
impl UnwindSafe for TypeError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more