reportAtToken method

Diagnostic? reportAtToken(
  1. Token token, {
  2. required DiagnosticCode diagnosticCode,
  3. List<Object> arguments = const [],
  4. List<DiagnosticMessage>? contextMessages,
})

Reports diagnosticCode at token, with message arguments and contextMessages.

The arguments are interpolated into the DiagnosticCode.problemMessage and DiagnosticCode.correctionMessage text. If present, the first argument (at position 0) replaces each instance of {0}, the second argument (at position 1) replaces each instance of {1}, etc.

Implementation

Diagnostic? reportAtToken(
  Token token, {
  required DiagnosticCode diagnosticCode,
  List<Object> arguments = const [],
  List<DiagnosticMessage>? contextMessages,
}) => _reportAtToken(
  token,
  diagnosticCode: diagnosticCode,
  arguments: arguments,
  contextMessages: contextMessages,
);