pub enum DotAccessKind {
StructField {
is_exported: bool,
},
TupleStructField {
is_newtype: bool,
},
TupleElement,
ModuleMember,
ValueEnumVariant,
EnumVariant,
InstanceMethod {
is_exported: bool,
},
InstanceMethodValue {
is_exported: bool,
is_pointer_receiver: bool,
},
StaticMethod {
is_exported: bool,
},
}Expand description
What a dot access resolved to during type checking.
Pre-computed in semantics to avoid re-derivation in the emitter.
The emitter can use this to skip cascading try_classify_* lookups.
is_exported indicates whether the Go name should be capitalized.
Variants§
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)
ModuleMember
Module member access (e.g., mod.func)
ValueEnumVariant
Value enum variant (Go constant, e.g., reflect.String)
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.
StaticMethod
Static method (no self receiver)
Trait Implementations§
Source§impl Clone for DotAccessKind
impl Clone for DotAccessKind
Source§fn clone(&self) -> DotAccessKind
fn clone(&self) -> DotAccessKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more