pub enum DotAccessResolution {
Unresolved,
StructField {
is_exported: bool,
declaring_type: Option<Symbol>,
},
TupleStructField {
is_newtype: bool,
},
TupleElement,
PackageMember {
definition: Option<Symbol>,
instantiation: SubstitutionMap,
},
EnumVariant {
definition: Symbol,
instantiation: SubstitutionMap,
},
InstanceMethod {
is_exported: bool,
receiver_coercion: Option<ReceiverCoercion>,
definition: Option<Symbol>,
instantiation: SubstitutionMap,
},
InstanceMethodValue {
is_exported: bool,
is_pointer_receiver: bool,
definition: Option<Symbol>,
instantiation: SubstitutionMap,
},
StaticMethod {
is_exported: bool,
definition: Symbol,
instantiation: SubstitutionMap,
},
}Expand description
What a dot access resolved to during type checking.
Variants§
Unresolved
StructField
Named struct field access
TupleStructField
Tuple struct field access (e.g., point.0 on struct Point(int, int)).
is_newtype is true when the struct has exactly 1 field and no generics,
meaning access should emit a type cast rather than .F0.
TupleElement
Tuple element access (e.g., t.0, t.1)
PackageMember
Package member access (e.g., mod.func)
EnumVariant
ADT enum variant constructor (e.g., makeColorRed[T]())
InstanceMethod
Instance method (has self receiver)
InstanceMethodValue
Instance method used as a first-class value (not called).
E.g., Point.area used as a callback. The emitter needs to know
whether the receiver is a pointer to emit Go method expression syntax.
Fields
§
instantiation: SubstitutionMapStaticMethod
Static method (no self receiver)
Implementations§
Source§impl DotAccessResolution
impl DotAccessResolution
pub fn is_field_read(&self) -> bool
pub fn declaring_type(&self) -> Option<&Symbol>
pub fn receiver_coercion(&self) -> Option<ReceiverCoercion>
pub fn definition(&self) -> Option<&str>
pub fn instantiation(&self) -> Option<&SubstitutionMap>
Trait Implementations§
Source§impl Clone for DotAccessResolution
impl Clone for DotAccessResolution
Source§impl Debug for DotAccessResolution
impl Debug for DotAccessResolution
impl Eq for DotAccessResolution
Source§impl PartialEq for DotAccessResolution
impl PartialEq for DotAccessResolution
impl StructuralPartialEq for DotAccessResolution
Auto Trait Implementations§
impl Freeze for DotAccessResolution
impl RefUnwindSafe for DotAccessResolution
impl Send for DotAccessResolution
impl Sync for DotAccessResolution
impl Unpin for DotAccessResolution
impl UnsafeUnpin for DotAccessResolution
impl UnwindSafe for DotAccessResolution
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