Case constructor
- Logic expression,
- List<
CaseItem> items, { - List<
Conditional> ? defaultItem, - ConditionalType conditionalType = ConditionalType.none,
Whenever an item in items matches expression, it will be executed.
If none of items match, then defaultItem
is executed.
Implementation
Case(this.expression, this.items,
{List<Conditional>? defaultItem,
this.conditionalType = ConditionalType.none})
: _defaultItem = defaultItem {
for (final item in items) {
if (item.value.width != expression.width) {
throw PortWidthMismatchException.equalWidth(expression, item.value);
}
}
}