pub struct TypedBlock {
pub stmts: Vec<TypedStmt>,
pub value: Option<Box<TypedExpr>>,
pub ty: QalaType,
pub span: Span,
}Expand description
a typed { ... } block. mirror of ast::Block, plus the resolved type of
the block’s value: ty is the type of the trailing value expression, or
QalaType::Void if there is no trailing value (the block ended in a ;
or was empty).
Fields§
§stmts: Vec<TypedStmt>the typed statements, in order.
value: Option<Box<TypedExpr>>the trailing expression (no terminating ;) that is the block’s value,
or None for a void block.
ty: QalaTypethe type of the trailing value expression, or QalaType::Void for an
empty / semicolon-ended block. the typechecker fills this; codegen reads
it to decide whether the block leaves a value on the stack.
span: Span{ to }.
Trait Implementations§
Source§impl Clone for TypedBlock
impl Clone for TypedBlock
Source§fn clone(&self) -> TypedBlock
fn clone(&self) -> TypedBlock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TypedBlock
impl Debug for TypedBlock
Source§impl PartialEq for TypedBlock
impl PartialEq for TypedBlock
Source§fn eq(&self, other: &TypedBlock) -> bool
fn eq(&self, other: &TypedBlock) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TypedBlock
Auto Trait Implementations§
impl Freeze for TypedBlock
impl RefUnwindSafe for TypedBlock
impl Send for TypedBlock
impl Sync for TypedBlock
impl Unpin for TypedBlock
impl UnsafeUnpin for TypedBlock
impl UnwindSafe for TypedBlock
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