pub struct ClassScope<'a> {
pub tree: &'a ItemTree,
pub base: Ty,
pub self_ty: Ty,
pub member_types: FxHashMap<SmolStr, Ty>,
/* private fields */
}Expand description
The class-member tier of the binder (Playbook §3.2 step 2): this file’s own members + the
resolved base type. Anonymous-enum variants are flattened in as int constants.
Fields§
§tree: &'a ItemTreeThe lowered item tree this scope describes.
base: TyThe resolved base type (Object(id) for an engine base, else Unknown).
self_ty: TyThe static type of self in this class’s bodies. Defaults to base, but
analyze_file overrides it with the script’s own Ty::ScriptRef so that member access
on an aliased self (var me := self; me.own_method()) walks the file’s own members
instead of only the engine base — otherwise a real own-method call would false-warn
UNSAFE_METHOD_ACCESS. (Direct self.member already uses the own-member fast path.)
member_types: FxHashMap<SmolStr, Ty>Resolved types of this class’s own fields (var/const), seeded by a first inference
pass over the field initializers so member references see the inferred type (e.g.
var n := 0 → int), not just the annotation. Empty until populated.
Implementations§
Source§impl<'a> ClassScope<'a>
impl<'a> ClassScope<'a>
Trait Implementations§
Source§impl<'a> Clone for ClassScope<'a>
impl<'a> Clone for ClassScope<'a>
Source§fn clone(&self) -> ClassScope<'a>
fn clone(&self) -> ClassScope<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for ClassScope<'a>
impl<'a> RefUnwindSafe for ClassScope<'a>
impl<'a> Send for ClassScope<'a>
impl<'a> Sync for ClassScope<'a>
impl<'a> Unpin for ClassScope<'a>
impl<'a> UnsafeUnpin for ClassScope<'a>
impl<'a> UnwindSafe for ClassScope<'a>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.