pub enum TypedSwitchValue {
Expr {
label: ExprId,
comparison: ExprId,
literal: Option<LiteralValue>,
span: Span,
},
String {
value: String,
span: Span,
},
Number {
value: f64,
span: Span,
},
Boolean {
value: bool,
span: Span,
},
Null {
span: Span,
},
Undefined {
span: Span,
},
Enum {
enum_name: MangledName,
member: Ident,
value: EnumVariantPayload,
span: Span,
},
}Expand description
A case label. span anchors fallthrough and duplicate-case diagnostics.
Variants§
Expr
A label that isn’t a literal, such as case one:, compared at run time.
Walkers visit comparison, which holds label.
Fields
§
comparison: ExprIddiscriminant === label. The discriminant is read from the
temporary the inferer binds it to, so the label can’t re-run it.
§
literal: Option<LiteralValue>The one value the label can have, when its type is a single literal: it then counts toward exhaustiveness as a literal label would.
String
Number
Boolean
Null
Undefined
Enum
value is the lowered runtime representation.
Trait Implementations§
Source§impl Clone for TypedSwitchValue
impl Clone for TypedSwitchValue
Source§impl Debug for TypedSwitchValue
impl Debug for TypedSwitchValue
Source§impl PartialEq for TypedSwitchValue
impl PartialEq for TypedSwitchValue
impl StructuralPartialEq for TypedSwitchValue
Auto Trait Implementations§
impl Freeze for TypedSwitchValue
impl RefUnwindSafe for TypedSwitchValue
impl Send for TypedSwitchValue
impl Sync for TypedSwitchValue
impl Unpin for TypedSwitchValue
impl UnsafeUnpin for TypedSwitchValue
impl UnwindSafe for TypedSwitchValue
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