visitLiteralListExpression method Null safety

  1. @override
StringSink visitLiteralListExpression(
  1. LiteralListExpression expression,
  2. [StringSink? output]
)
override

Implementation

@override
StringSink visitLiteralListExpression(
  LiteralListExpression expression, [
  StringSink? output,
]) {
  final out = output ??= StringBuffer();

  return _writeConstExpression(output, expression.isConst, () {
    if (expression.type != null) {
      out.write('<');
      expression.type!.accept(this, output);
      out.write('>');
    }
    out.write('[');
    visitAll<Object?>(expression.values, out, (value) {
      _acceptLiteral(value, out);
    });
    return out..write(']');
  });
}