pub struct TypedClassDecl {
pub name: Ident,
pub fields: Vec<TypedClassField>,
pub static_methods: BTreeMap<String, Visibility>,
pub static_fields: BTreeMap<String, FieldSig>,
pub constructor: Option<TypedClassConstructor>,
pub inherited_ctor_params: Vec<TypedParam>,
pub methods: Vec<TypedClassMethod>,
pub accessors: Vec<TypedClassAccessor>,
pub extends: Option<MangledName>,
pub implements: Vec<MangledName>,
pub mangled_name: MangledName,
pub doc: Option<DocComment>,
}Expand description
A typechecked class. Method/constructor bodies are checked in the class-body pass; codegen (SUB-480+) consumes the field layout, body IDs, and signatures.
Fields§
§name: Ident§fields: Vec<TypedClassField>§static_methods: BTreeMap<String, Visibility>Static member visibility retained for analyses that run after package declarations have been reduced to their runtime surface.
static_fields: BTreeMap<String, FieldSig>Static field signatures are lowered to globals, but their source-level visibility and callable types remain relevant to public-surface analysis.
constructor: Option<TypedClassConstructor>§inherited_ctor_params: Vec<TypedParam>The signature a class with no constructor of its own exposes, taken
from the nearest ancestor that declares one with the extends clause’s
type arguments already substituted. Empty when constructor is Some.
This is what the package declaration exports and what a cross-package consumer imports, so the emitted constructor must use it rather than re-deriving the parent’s unsubstituted parameters — the two disagree the moment a subclass fixes a generic parent’s type argument.
methods: Vec<TypedClassMethod>§accessors: Vec<TypedClassAccessor>Accessor functions (get/set), one entry each — getter and setter are
symmetric, neither is required (a property may be get-only, set-only, or
both). They are not in methods; codegen synthesizes the vtable method
per entry (see codegen::classes).
extends: Option<MangledName>§implements: Vec<MangledName>§mangled_name: MangledName§doc: Option<DocComment>Implementations§
Source§impl TypedClassDecl
impl TypedClassDecl
Sourcepub fn effective_ctor_params(&self) -> &[TypedParam]
pub fn effective_ctor_params(&self) -> &[TypedParam]
The constructor signature this class exposes: its own if it declares
one, otherwise the inherited signature. Callers should prefer this over
reading either field directly — inherited_ctor_params is meaningful
only when constructor is None.