SelectExpression class final

A pattern selection: chooses one of several [key] pattern variants based on the value of selector.

Exactly one variant must be marked as the default (chosen when no other variant matches at runtime). Per spec, SelectExpression is itself an Expression but NOT an InlineExpression — it cannot be nested inside another expression position; it can only appear as the sole expression of a placeable.

Inheritance

Constructors

SelectExpression(InlineExpression selector, List<Variant> variants, {Span? span})
Selects among variants by the selector's value.
const

Properties

defaultVariant Variant
The default variant. Asserts that exactly one is marked default.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selector InlineExpression
The expression whose value picks a variant.
final
span Span?
Source range this node covers; null when spans were off.
final
variants List<Variant>
Every variant, in source order; exactly one is the default.
final

Methods

clone() SelectExpression
Deep clone of this node.
override
equals(FluentNode other, {bool ignoreSpans = true}) bool
Structural equality.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited