Skip to content

Commit

Permalink
Elements. Remove 'as TypeImpl' in ErrorVerifier.
Browse files Browse the repository at this point in the history
Change-Id: I3447a6b11468d7ded0de6f3e134cbde195977221
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412102
Reviewed-by: Paul Berry <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
  • Loading branch information
scheglov authored and Commit Queue committed Feb 26, 2025
1 parent 5474ca8 commit 27cc757
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/analyzer/lib/src/generated/error_verifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,11 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
}

@override
void visitAssignmentExpression(AssignmentExpression node) {
void visitAssignmentExpression(covariant AssignmentExpressionImpl node) {
TokenType operatorType = node.operator.type;
Expression lhs = node.leftHandSide;
if (operatorType == TokenType.QUESTION_QUESTION_EQ) {
_checkForDeadNullCoalesce(node.readType as TypeImpl, node.rightHandSide);
_checkForDeadNullCoalesce(node.readType!, node.rightHandSide);
}
_checkForAssignmentToFinal(lhs);

Expand All @@ -369,7 +369,7 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
}

@override
void visitBinaryExpression(BinaryExpression node) {
void visitBinaryExpression(covariant BinaryExpressionImpl node) {
Token operator = node.operator;
TokenType type = operator.type;
if (type == TokenType.AMPERSAND_AMPERSAND || type == TokenType.BAR_BAR) {
Expand All @@ -380,7 +380,7 @@ class ErrorVerifier extends RecursiveAstVisitor<void>

if (type == TokenType.QUESTION_QUESTION) {
_checkForDeadNullCoalesce(
node.leftOperand.staticType as TypeImpl, node.rightOperand);
node.leftOperand.staticType!, node.rightOperand);
}

checkForUseOfVoidResult(node.leftOperand);
Expand Down Expand Up @@ -944,7 +944,7 @@ class ErrorVerifier extends RecursiveAstVisitor<void>

@override
void visitFunctionDeclaration(covariant FunctionDeclarationImpl node) {
var fragment = node.declaredFragment!;
var fragment = node.declaredFragment!;
var element = fragment.element;
if (element.enclosingElement2 is! LibraryElement2) {
_hiddenElements!.declare(element);
Expand Down Expand Up @@ -2106,8 +2106,10 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
/// [exportedLibrary] is the library element containing the exported element.
///
/// See [CompileTimeErrorCode.AMBIGUOUS_EXPORT].
void _checkForAmbiguousExport(ExportDirectiveImpl directive,
LibraryExportElementImpl libraryExport, LibraryElementImpl? exportedLibrary) {
void _checkForAmbiguousExport(
ExportDirectiveImpl directive,
LibraryExportElementImpl libraryExport,
LibraryElementImpl? exportedLibrary) {
if (exportedLibrary == null) {
return;
}
Expand Down

0 comments on commit 27cc757

Please sign in to comment.