reportErrorForName method
void
reportErrorForName(
- ErrorCode code,
- ConstructorDeclaration constructor, {
- List<
Object> ? arguments,
Report a diagnostic with the given code
and arguments
. The
location of the diagnostic will be the name of the constructor
.
Implementation
void reportErrorForName(ErrorCode code, ConstructorDeclaration constructor,
{List<Object>? arguments}) {
// TODO(brianwilkerson) Consider extending this method to take any
// declaration and compute the correct range for the name of that
// declaration. This might make it easier to be consistent.
if (constructor.name2 != null) {
var offset = constructor.returnType.offset;
reportErrorForOffset(
code, offset, constructor.name2!.end - offset, arguments);
} else {
reportErrorForNode(code, constructor.returnType, arguments);
}
}