visitType method Null safety

  1. @override
StringSink visitType(
  1. TypeReference spec,
  2. [StringSink? output]
)

Implementation

@override
StringSink visitType(TypeReference spec, [StringSink? output]) {
  output ??= StringBuffer();
  // Intentionally not .accept to avoid stack overflow.
  visitReference(spec, output);
  if (spec.bound != null) {
    output.write(' extends ');
    spec.bound!.type.accept(this, output);
  }
  visitTypeParameters(spec.types.map((r) => r.type), output);
  if (_useNullSafetySyntax && (spec.isNullable ?? false)) {
    output.write('?');
  }
  return output;
}