Struct erg_compiler::varinfo::VarInfo
source · pub struct VarInfo {
pub t: Type,
pub muty: Mutability,
pub vis: Visibility,
pub kind: VarKind,
pub comptime_decos: Option<Set<Str>>,
pub impl_of: Option<Type>,
pub py_name: Option<Str>,
pub def_loc: AbsLocation,
}
Expand description
Has information about the type, variability, visibility, and where the variable was defined (or declared, generated)
Fields§
§t: Type
§muty: Mutability
§vis: Visibility
§kind: VarKind
§comptime_decos: Option<Set<Str>>
§impl_of: Option<Type>
§py_name: Option<Str>
§def_loc: AbsLocation
Implementations§
source§impl VarInfo
impl VarInfo
pub const ILLEGAL: &'static Self = _
pub const fn const_default_private() -> Self
pub const fn const_default_public() -> Self
pub const fn new( t: Type, muty: Mutability, vis: Visibility, kind: VarKind, comptime_decos: Option<Set<Str>>, impl_of: Option<Type>, py_name: Option<Str>, def_loc: AbsLocation ) -> Self
pub fn same_id_as(&self, id: DefId) -> bool
pub fn nd_parameter(t: Type, def_loc: AbsLocation, namespace: Str) -> Self
pub fn instance_attr( field: Field, t: Type, impl_of: Option<Type>, namespace: Str ) -> Self
Trait Implementations§
source§impl HasType for VarInfo
impl HasType for VarInfo
fn ref_t(&self) -> &Type
source§fn ref_mut_t(&mut self) -> &mut Type
fn ref_mut_t(&mut self) -> &mut Type
x.ref_mut_t()
may panic, in which case x
is Call
and x.ref_t() == Type::Failure
.