ErrorReporter class

An object used to create analysis errors and report then to an error listener.

Constructors

ErrorReporter(AnalysisErrorListener _errorListener, Source _defaultSource, {bool isNonNullableByDefault: false})
Initialize a newly created error reporter that will report errors to the given _errorListener. Errors will be reported against the _defaultSource unless another source is provided later.

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
isNonNullableByDefault bool
Is true if the library being analyzed is non-nullable by default.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
source ↔ Source
Set the source to be used when reporting errors to the given source. Setting the source to null will cause the default source to be used.
@Deprecated('Create separate reporters for separate files'), read / write

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
reportError(AnalysisError error) → void
Report the given error.
reportErrorForElement(ErrorCode errorCode, Element element, [List<Object> arguments]) → void
Report an error with the given errorCode and arguments. The element is used to compute the location of the error.
reportErrorForName(ErrorCode code, ConstructorDeclaration constructor, {List<Object> arguments}) → void
Report a diagnostic with the given code and arguments. The location of the diagnostic will be the name of the constructor.
reportErrorForNode(ErrorCode errorCode, AstNode node, [List<Object> arguments]) → void
Report an error with the given errorCode and arguments. The node is used to compute the location of the error.
reportErrorForOffset(ErrorCode errorCode, int offset, int length, [List<Object> arguments]) → void
Report an error with the given errorCode and arguments. The location of the error is specified by the given offset and length.
reportErrorForSpan(ErrorCode errorCode, SourceSpan span, [List<Object> arguments]) → void
Report an error with the given errorCode and arguments. The location of the error is specified by the given span.
reportErrorForToken(ErrorCode errorCode, Token token, [List<Object> arguments]) → void
Report an error with the given errorCode and arguments. The token is used to compute the location of the error.
reportErrorMessage(ErrorCode errorCode, int offset, int length, Message message) → void
Report an error with the given errorCode and message. The location of the error is specified by the given offset and length.
reportTypeErrorForNode(ErrorCode errorCode, AstNode node, List<Object> arguments) → void
Report an error with the given errorCode and arguments. The node is used to compute the location of the error. The arguments are expected to contain two or more types. Convert the types into strings by using the display names of the types, unless there are two or more types with the same names, in which case the extended display names of the types will be used in order to clarify the message. [...]
@Deprecated('Use reportErrorForNode(), it will convert types as well')
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited