pub enum Type {
Show 17 variants
Int,
Float,
String,
Bool,
Unit,
Never,
Array(ArrayTypeRef),
Tuple(TupleTypeRef),
NamedStruct(StructTypeRef),
AnonymousStruct(AnonymousStructType),
Map(MapTypeRef),
Enum(EnumTypeRef),
Generic(Box<Type>, Vec<Type>),
Function(Signature),
Iterable(Box<Type>),
Optional(Box<Type>),
External(ExternalTypeRef),
}
Variants§
Int
Float
String
Bool
Unit
Never
Array(ArrayTypeRef)
Tuple(TupleTypeRef)
NamedStruct(StructTypeRef)
AnonymousStruct(AnonymousStructType)
Map(MapTypeRef)
Enum(EnumTypeRef)
Generic(Box<Type>, Vec<Type>)
Function(Signature)
Iterable(Box<Type>)
Optional(Box<Type>)
External(ExternalTypeRef)
Implementations§
Source§impl Type
impl Type
pub const fn is_concrete(&self) -> bool
pub fn id(&self) -> Option<TypeNumber>
Source§impl Type
impl Type
pub fn expect_struct_type(&self) -> Result<StructTypeRef, SemanticError>
pub fn assignable_type(&self, other: &Type) -> bool
pub fn compatible_with(&self, other: &Type) -> bool
Trait Implementations§
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl !RefUnwindSafe for Type
impl !Send for Type
impl !Sync for Type
impl Unpin for Type
impl !UnwindSafe for Type
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