ErrorReporter class

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

Constructors

ErrorReporter.new(AnalysisErrorListener _errorListener, Source _source)
Initializes a newly created error reporter that will report errors to the given _errorListener.

Properties

hashCode int
The hash code for this object.
no setterinherited
lockLevel int
The lock level, if greater than zero, no errors will be reported. This is used to prevent reporting errors inside comments.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source Source
no setter

Methods

atConstructorDeclaration(ConstructorDeclaration node, ErrorCode errorCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) → void
Report a diagnostic with the given errorCode and arguments. The location of the diagnostic will be the name of the node.
atElement(Element element, ErrorCode errorCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) → void
Report an error with the given errorCode and arguments. The element is used to compute the location of the error.
atElement2(Element2 element2, ErrorCode errorCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) → void
Report an error with the given errorCode and arguments. The element is used to compute the location of the error.
atEntity(SyntacticEntity entity, ErrorCode errorCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) → void
Report an error with the given errorCode and arguments. The entity is used to compute the location of the error.
atNode(AstNode node, ErrorCode errorCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) → void
Report an error with the given errorCode and arguments. The node is used to compute the location of the error.
atOffset({required int offset, required int length, required ErrorCode errorCode, List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) → void
Report an error with the given errorCode and arguments. The location of the error is specified by the given offset and length.
atSourceSpan(SourceSpan span, ErrorCode errorCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) → void
Report an error with the given errorCode and arguments. The span is used to compute the location of the error.
atToken(Token token, ErrorCode errorCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}) → void
Report an error with the given errorCode and arguments. The token is used to compute the location of the error.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reportError(AnalysisError error) → void
Report the given error.
toString() String
A string representation of this object.
inherited

Operators

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