Struct erg_compiler::hir::ClassDef
source · pub struct ClassDef {
pub obj: GenTypeObj,
pub sig: Signature,
pub require_or_sup: Option<Box<Expr>>,
pub need_to_gen_new: bool,
pub __new__: Type,
pub methods: Block,
}
Fields§
§obj: GenTypeObj
§sig: Signature
§require_or_sup: Option<Box<Expr>>
§need_to_gen_new: bool
The type of new
that is automatically defined if not defined
__new__: Type
§methods: Block
Implementations§
Trait Implementations§
source§impl HasType for ClassDef
impl HasType for ClassDef
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
.fn signature_t(&self) -> Option<&Type>
fn signature_mut_t(&mut self) -> Option<&mut Type>
fn t(&self) -> Type
fn inner_ts(&self) -> Vec<Type>
fn lhs_t(&self) -> &Type
fn rhs_t(&self) -> &Type
source§impl Locational for ClassDef
impl Locational for ClassDef
source§fn loc(&self) -> Location
fn loc(&self) -> Location
NOTE:
loc
cannot be treated as a light method when self
is a large grammatical element.
If possible, delay the computation by passing &impl Locational
or other means.