Skip to content

Commit d2d4325

Browse files
pqCommit Queue
authored andcommitted
[element model] migrate unawaited_futures
Bug: https://github.com/dart-lang/linter/issues/5099 Change-Id: I40c714c5416c0904d42dd697911747547ec0db8d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393046 Auto-Submit: Phil Quitslund <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]> Commit-Queue: Phil Quitslund <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent d5e19c6 commit d2d4325

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/linter/lib/src/rules/unawaited_futures.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import 'package:analyzer/dart/ast/ast.dart';
66
import 'package:analyzer/dart/ast/visitor.dart';
7-
import 'package:analyzer/dart/element/element.dart';
7+
import 'package:analyzer/dart/element/element2.dart';
88

99
import '../analyzer.dart';
1010
import '../extensions.dart';
@@ -87,14 +87,14 @@ class _Visitor extends SimpleAstVisitor<void> {
8787
expr.constructorName.name?.name == 'delayed' &&
8888
expr.argumentList.arguments.length == 2;
8989

90-
bool _isMapClass(Element? e) =>
91-
e is ClassElement && e.name == 'Map' && e.library.name == 'dart.core';
90+
bool _isMapClass(Element2? e) =>
91+
e is ClassElement2 && e.name3 == 'Map' && e.library2.name3 == 'dart.core';
9292

9393
/// Detects Map.putIfAbsent invocations.
9494
bool _isMapPutIfAbsentInvocation(Expression expr) =>
9595
expr is MethodInvocation &&
9696
expr.methodName.name == 'putIfAbsent' &&
97-
_isMapClass(expr.methodName.staticElement?.enclosingElement3);
97+
_isMapClass(expr.methodName.element?.enclosingElement2);
9898

9999
void _visit(Expression expr) {
100100
if ((expr.staticType?.isDartAsyncFuture ?? false) &&

0 commit comments

Comments
 (0)