Const constructor

Const(
  1. dynamic val,
  2. {int? width,
  3. bool fill = false}
)

Constructs a Const with the specified value.

val should be processable by LogicValue.of.

Implementation

Const(dynamic val, {int? width, bool fill = false})
    : super(
        name: 'const_$val',
        width: val is LogicValue ? val.width : width ?? 1,
        // we don't care about maintaining this node unless necessary
        naming: Naming.unnamed,
      ) {
  put(val, fill: fill);
  _unassignable = true;
}