Skip to main content

ResolvedExpr

Enum ResolvedExpr 

Source
pub enum ResolvedExpr {
Show 18 variants Literal(Literal), Ident(String), Resolved { slot: u16, name: String, last_use: AnnotBool, }, Attr(Box<Spanned<ResolvedExpr>>, String), Call(ResolvedCallee, Vec<Spanned<ResolvedExpr>>), BinOp(BinOp, Box<Spanned<ResolvedExpr>>, Box<Spanned<ResolvedExpr>>), Neg(Box<Spanned<ResolvedExpr>>), Match { subject: Box<Spanned<ResolvedExpr>>, arms: Vec<ResolvedMatchArm>, }, Ctor(ResolvedCtor, Vec<Spanned<ResolvedExpr>>), ErrorProp(Box<Spanned<ResolvedExpr>>), InterpolatedStr(Vec<ResolvedStrPart>), List(Vec<Spanned<ResolvedExpr>>), Tuple(Vec<Spanned<ResolvedExpr>>), MapLiteral(Vec<(Spanned<ResolvedExpr>, Spanned<ResolvedExpr>)>), RecordCreate { type_id: Option<TypeId>, type_name: String, fields: Vec<(String, Spanned<ResolvedExpr>)>, }, RecordUpdate { type_id: Option<TypeId>, type_name: String, base: Box<Spanned<ResolvedExpr>>, updates: Vec<(String, Spanned<ResolvedExpr>)>, }, TailCall { target: FnId, args: Vec<Spanned<ResolvedExpr>>, }, IndependentProduct(Vec<Spanned<ResolvedExpr>>, bool),
}
Expand description

Resolved expression — the mechanical mirror of crate::ast::Expr.

Every variant that referenced a declared symbol by string in Expr now carries its opaque ID. Variants that didn’t reference any declaration pass through unchanged in shape.

Variants§

§

Literal(Literal)

Literal — untouched.

§

Ident(String)

Source-level identifier that the resolver pass could NOT classify into a Resolved slot, a fn ref, or a constructor. Typically a top-level / global binding name; backends look it up in the post-resolve global table.

After full Phase E + D, this variant should rarely survive — every name has either a slot, an FnId, a CtorId, or fails to type-check. Kept here as the safety hatch during migration.

§

Resolved

Compiled local-slot reference. Identical to Expr::Resolved — the slot resolver runs before name-resolve and its output is already typed identity.

Fields

§slot: u16
§name: String
§last_use: AnnotBool
§

Attr(Box<Spanned<ResolvedExpr>>, String)

Field / namespace projection. The object is recursively resolved; the field name stays as source text because record fields are scoped under their owning TypeId, not in a global namespace.

§

Call(ResolvedCallee, Vec<Spanned<ResolvedExpr>>)

Function call — Expr::FnCall(callee, args) lifted into a ResolvedCallee.

§

BinOp(BinOp, Box<Spanned<ResolvedExpr>>, Box<Spanned<ResolvedExpr>>)

Binary operator.

§

Neg(Box<Spanned<ResolvedExpr>>)

Unary minus.

§

Match

match subject { arm, … }.

§

Ctor(ResolvedCtor, Vec<Spanned<ResolvedExpr>>)

Constructor call — Result.Ok(v), Shape.Circle(r), etc.

§

ErrorProp(Box<Spanned<ResolvedExpr>>)

Result-error propagation: expr?.

§

InterpolatedStr(Vec<ResolvedStrPart>)

Interpolated string "a${x}b".

§

List(Vec<Spanned<ResolvedExpr>>)

[a, b, c] list literal.

§

Tuple(Vec<Spanned<ResolvedExpr>>)

(a, b, c) tuple literal.

§

MapLiteral(Vec<(Spanned<ResolvedExpr>, Spanned<ResolvedExpr>)>)

{"a" => 1, "b" => 2} map literal.

§

RecordCreate

Shape(name = "...", count = 0) record-create form. The type_id is Some for user records resolved through the symbol table, None for built-in record types (HttpResponse, Header, Tcp.Connection, Buffer, …) which don’t carry TypeIds by design.

Fields

§type_id: Option<TypeId>
§type_name: String

Source-level type name kept verbatim for diagnostics + backend codegen mangling. Mirrors Type::Named { name }.

§

RecordUpdate

Shape.update(base, field = newVal, …) record-update.

Fields

§type_id: Option<TypeId>
§type_name: String
§

TailCall

Tail-position call (SCC peer). target is the FnId the TCO transform pass committed to.

Fields

§target: FnId
§

IndependentProduct(Vec<Spanned<ResolvedExpr>>, bool)

Independent product (a, b)! or (a, b)?!. unwrap toggles the ?! form.

Trait Implementations§

Source§

impl Clone for ResolvedExpr

Source§

fn clone(&self) -> ResolvedExpr

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResolvedExpr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ResolvedExpr

Source§

fn eq(&self, other: &ResolvedExpr) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ResolvedExpr

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V