Skip to content

Commit 27cc757

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Remove 'as TypeImpl' in ErrorVerifier.
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]>
1 parent 5474ca8 commit 27cc757

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

pkg/analyzer/lib/src/generated/error_verifier.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,11 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
342342
}
343343

344344
@override
345-
void visitAssignmentExpression(AssignmentExpression node) {
345+
void visitAssignmentExpression(covariant AssignmentExpressionImpl node) {
346346
TokenType operatorType = node.operator.type;
347347
Expression lhs = node.leftHandSide;
348348
if (operatorType == TokenType.QUESTION_QUESTION_EQ) {
349-
_checkForDeadNullCoalesce(node.readType as TypeImpl, node.rightHandSide);
349+
_checkForDeadNullCoalesce(node.readType!, node.rightHandSide);
350350
}
351351
_checkForAssignmentToFinal(lhs);
352352

@@ -369,7 +369,7 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
369369
}
370370

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

381381
if (type == TokenType.QUESTION_QUESTION) {
382382
_checkForDeadNullCoalesce(
383-
node.leftOperand.staticType as TypeImpl, node.rightOperand);
383+
node.leftOperand.staticType!, node.rightOperand);
384384
}
385385

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

945945
@override
946946
void visitFunctionDeclaration(covariant FunctionDeclarationImpl node) {
947-
var fragment = node.declaredFragment!;
947+
var fragment = node.declaredFragment!;
948948
var element = fragment.element;
949949
if (element.enclosingElement2 is! LibraryElement2) {
950950
_hiddenElements!.declare(element);
@@ -2106,8 +2106,10 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
21062106
/// [exportedLibrary] is the library element containing the exported element.
21072107
///
21082108
/// See [CompileTimeErrorCode.AMBIGUOUS_EXPORT].
2109-
void _checkForAmbiguousExport(ExportDirectiveImpl directive,
2110-
LibraryExportElementImpl libraryExport, LibraryElementImpl? exportedLibrary) {
2109+
void _checkForAmbiguousExport(
2110+
ExportDirectiveImpl directive,
2111+
LibraryExportElementImpl libraryExport,
2112+
LibraryElementImpl? exportedLibrary) {
21112113
if (exportedLibrary == null) {
21122114
return;
21132115
}

0 commit comments

Comments
 (0)