Remove unused ResolverVisitor.resolveOnlyCommentInFunctionBody
This was an attempt at incremental resolution that was introduced in
2014 (0bb68fba0a6e934e5a13f7037b0575e623c9c7ba) and then stopped being
used in 2017 (d56690616761579b7a311e794cc43f45508ef272).
Getting rid of it will simplify some refactoring of function body
visitors that I want to do in follow-up CLs.
Change-Id: I65958480d440e7222da336d5682e6dd3b8358825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418300
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 24ae448..ffb3167 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -255,14 +255,6 @@
final FlowAnalysisHelper flowAnalysis;
- /// A comment before a function should be resolved in the context of the
- /// function. But when we incrementally resolve a comment, we don't want to
- /// resolve the whole function.
- ///
- /// So, this flag is set to `true`, when just context of the function should
- /// be built and the comment resolved.
- bool resolveOnlyCommentInFunctionBody = false;
-
/// Stack of expressions which we have not yet finished visiting, that should
/// terminate a null-shorting expression.
///
@@ -2300,10 +2292,8 @@
@override
TypeImpl visitEmptyFunctionBody(EmptyFunctionBody node,
{TypeImpl? imposedType}) {
- if (!resolveOnlyCommentInFunctionBody) {
- checkUnreachableNode(node);
- node.visitChildren(this);
- }
+ checkUnreachableNode(node);
+ node.visitChildren(this);
return imposedType ?? typeProvider.dynamicType;
}
@@ -2434,10 +2424,6 @@
TypeImpl visitExpressionFunctionBody(
covariant ExpressionFunctionBodyImpl node,
{TypeImpl? imposedType}) {
- if (resolveOnlyCommentInFunctionBody) {
- return imposedType ?? typeProvider.dynamicType;
- }
-
var oldBodyContext = _bodyContext;
try {
var bodyContext = _bodyContext = BodyInferenceContext(