Fix isAbstract when MethodDeclaration is lazy.

R=brianwilkerson@google.com

Change-Id: Id03af715acdd446e5210f8fc4efbc0a2ca641fd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101202
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/lib/src/summary2/lazy_ast.dart b/pkg/analyzer/lib/src/summary2/lazy_ast.dart
index 2553ef2..9f7fd21 100644
--- a/pkg/analyzer/lib/src/summary2/lazy_ast.dart
+++ b/pkg/analyzer/lib/src/summary2/lazy_ast.dart
@@ -1108,6 +1108,16 @@
     return LazyAst.getReturnType(node);
   }
 
+  static bool isAbstract(MethodDeclaration node) {
+    var lazy = get(node);
+    if (lazy != null) {
+      return lazy.data.methodDeclaration_body.kind ==
+          LinkedNodeKind.emptyFunctionBody;
+    } else {
+      return node.isAbstract;
+    }
+  }
+
   static void readBody(
     AstBinaryReader reader,
     MethodDeclaration node,
diff --git a/pkg/analyzer/lib/src/summary2/linked_unit_context.dart b/pkg/analyzer/lib/src/summary2/linked_unit_context.dart
index ee083b1..11afe36 100644
--- a/pkg/analyzer/lib/src/summary2/linked_unit_context.dart
+++ b/pkg/analyzer/lib/src/summary2/linked_unit_context.dart
@@ -772,7 +772,7 @@
     } else if (node is FunctionDeclaration) {
       return false;
     } else if (node is MethodDeclaration) {
-      return node.isAbstract;
+      return LazyMethodDeclaration.isAbstract(node);
     }
     throw UnimplementedError('${node.runtimeType}');
   }