visitLiteralSetExpression method Null safety

  1. @override
StringSink visitLiteralSetExpression(
  1. LiteralSetExpression expression,
  2. [StringSink? output]
)
override

Implementation

@override
StringSink visitLiteralSetExpression(
  LiteralSetExpression 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('}');
  });
}