Skip to content

Commit c53347d

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ class _Visitor extends SimpleAstVisitor<void> {
6464

6565
DartType? returnType;
6666
if (parent is FunctionExpression) {
67-
returnType = parent.declaredElement?.returnType;
67+
returnType = parent.declaredFragment?.element.returnType;
6868
} else if (parent is MethodDeclaration) {
69-
returnType = parent.declaredElement?.returnType;
69+
returnType = parent.declaredFragment?.element.returnType;
7070
} else if (parent is Block) {
7171
// removing await in try block changes the behaviour
7272
return;

0 commit comments

Comments
 (0)