MemoryModelEnumConstraint constructor
Freezes the field's legal encodings.
Implementation
MemoryModelEnumConstraint({
required this.offset,
required this.width,
required Iterable<BigInt> encodings,
}) : encodings = List.unmodifiable(encodings) {
if (offset < 0 ||
width < 1 ||
this.encodings.isEmpty ||
this.encodings.any(
(value) => value < BigInt.zero || value >= (BigInt.one << width))) {
throw ArgumentError('Invalid enum payload constraint.');
}
}