diff --git a/pkg/analyzer/lib/src/dart/resolver/flow_analysis_visitor.dart b/pkg/analyzer/lib/src/dart/resolver/flow_analysis_visitor.dart index a9a11e2c9856..b11638848720 100644 --- a/pkg/analyzer/lib/src/dart/resolver/flow_analysis_visitor.dart +++ b/pkg/analyzer/lib/src/dart/resolver/flow_analysis_visitor.dart @@ -77,7 +77,7 @@ class FlowAnalysisHelper { final TypeSystemOperations typeOperations; /// Precomputed sets of potentially assigned variables. - AssignedVariables? assignedVariables; + AssignedVariables? assignedVariables; /// The result for post-resolution stages of analysis, for testing only. final FlowAnalysisDataForTesting? dataForTesting; @@ -96,8 +96,8 @@ class FlowAnalysisHelper { final bool inferenceUpdate4Enabled; /// The current flow, when resolving a function body, or `null` otherwise. - FlowAnalysis>? flow; + FlowAnalysis>? flow; FlowAnalysisHelper(bool retainDataForTesting, FeatureSet featureSet, {required TypeSystemOperations typeSystemOperations}) @@ -174,10 +174,10 @@ class FlowAnalysisHelper { retainDataForTesting: dataForTesting != null, visit: visit); if (dataForTesting != null) { dataForTesting!.assignedVariables[node] = assignedVariables - as AssignedVariablesForTesting; + as AssignedVariablesForTesting; } flow = isNonNullableByDefault - ? FlowAnalysis>( typeOperations, assignedVariables!, @@ -186,7 +186,7 @@ class FlowAnalysisHelper { fieldPromotionEnabled: fieldPromotionEnabled, inferenceUpdate4Enabled: inferenceUpdate4Enabled, ) - : FlowAnalysis>.legacy( typeOperations, assignedVariables!); } @@ -228,7 +228,7 @@ class FlowAnalysisHelper { } void executableDeclaration_enter( - AstNode node, FormalParameterList? parameters, + AstNodeImpl node, FormalParameterList? parameters, {required bool isClosure}) { if (isClosure) { flow!.functionExpression_begin(node); @@ -261,7 +261,7 @@ class FlowAnalysisHelper { flow?.for_bodyBegin(node is StatementImpl ? node : null, condition); } - void for_conditionBegin(AstNode node) { + void for_conditionBegin(AstNodeImpl node) { flow?.for_conditionBegin(node); } @@ -348,11 +348,11 @@ class FlowAnalysisHelper { } /// Computes the [AssignedVariables] map for the given [node]. - static AssignedVariables + static AssignedVariables computeAssignedVariables(AstNode node, FormalParameterList? parameters, {bool retainDataForTesting = false, void Function(AstVisitor visitor)? visit}) { - AssignedVariables assignedVariables = + AssignedVariables assignedVariables = retainDataForTesting ? AssignedVariablesForTesting() : AssignedVariables(); diff --git a/pkg/analyzer/lib/src/dart/resolver/for_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/for_resolver.dart index aaf736ce2b79..4c4bf7480916 100644 --- a/pkg/analyzer/lib/src/dart/resolver/for_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/for_resolver.dart @@ -120,8 +120,8 @@ class ForResolver { return iteratedType.typeArguments.single; } - void _forEachParts(AstNode node, bool isAsync, ForEachPartsImpl forEachParts, - void Function() visitBody) { + void _forEachParts(AstNodeImpl node, bool isAsync, + ForEachPartsImpl forEachParts, void Function() visitBody) { ExpressionImpl iterable = forEachParts.iterable; DeclaredIdentifierImpl? loopVariable; SimpleIdentifierImpl? identifier; @@ -200,7 +200,7 @@ class ForResolver { } void _forParts( - AstNode node, ForPartsImpl forParts, void Function() visitBody) { + AstNodeImpl node, ForPartsImpl forParts, void Function() visitBody) { if (forParts is ForPartsWithDeclarationsImpl) { forParts.variables.accept(_resolver); } else if (forParts is ForPartsWithExpressionImpl) { diff --git a/pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart b/pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart index e8f47fa6248f..a7b457a14898 100644 --- a/pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart +++ b/pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart @@ -22,7 +22,7 @@ typedef SharedPatternField class SharedTypeAnalyzerErrors implements shared.TypeAnalyzerErrors< - AstNode, + AstNodeImpl, StatementImpl, ExpressionImpl, PromotableElementImpl2, diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart index f1b19499b67d..5149e927c913 100644 --- a/pkg/analyzer/lib/src/generated/resolver.dart +++ b/pkg/analyzer/lib/src/generated/resolver.dart @@ -97,7 +97,7 @@ import 'package:analyzer/src/utilities/extensions/object.dart'; /// By default, no files have inference logging enabled. bool Function(Source) inferenceLoggingPredicate = (_) => false; -typedef SharedMatchContext = shared.MatchContext, PromotableElementImpl2>; typedef SharedPatternField @@ -122,7 +122,7 @@ class ResolverVisitor extends ThrowingAstVisitor ErrorDetectionHelpers, TypeAnalyzer< DartType, - AstNode, + AstNodeImpl, StatementImpl, ExpressionImpl, PromotableElementImpl2, @@ -437,7 +437,11 @@ class ResolverVisitor extends ThrowingAstVisitor ExecutableElement? get enclosingFunction => _enclosingFunction; @override - FlowAnalysis> get flow => flowAnalysis.flow!; bool get isConstructorTearoffsEnabled => @@ -810,7 +814,7 @@ class ResolverVisitor extends ThrowingAstVisitor @override PatternResult dispatchPattern( - SharedMatchContext context, AstNode node) { + SharedMatchContext context, AstNodeImpl node) { shared.PatternResult analysisResult; if (node is DartPatternImpl) { analysisResult = node.resolvePattern(this, context); @@ -977,8 +981,8 @@ class ResolverVisitor extends ThrowingAstVisitor } @override - SwitchExpressionMemberInfo - getSwitchExpressionMemberInfo( + SwitchExpressionMemberInfo getSwitchExpressionMemberInfo( covariant SwitchExpressionImpl node, int index, ) { @@ -995,12 +999,12 @@ class ResolverVisitor extends ThrowingAstVisitor } @override - SwitchStatementMemberInfo getSwitchStatementMemberInfo( covariant SwitchStatementImpl node, int index, ) { - CaseHeadOrDefaultInfo + CaseHeadOrDefaultInfo ofMember( SwitchMemberImpl member, ) { @@ -3792,7 +3796,7 @@ class ResolverVisitor extends ThrowingAstVisitor } @override - void visitTryStatement(TryStatement node) { + void visitTryStatement(covariant TryStatementImpl node) { inferenceLogWriter?.enterStatement(node); checkUnreachableNode(node); var flow = flowAnalysis.flow!;