Skip to content

Commit f023483

Browse files
stereotype441Commit Queue
authored andcommitted
[analyzer] Use DartPatternImpl when interfacing with shared code
Change the analyzer's use of the following generic types so that it supplies the type parameter `DartPatternImpl` instead of `DartPattern` as the type of AST node it uses to represent patterns: - `MapPatternEntry` - `MatchContext` - `TypeAnalyzer` - `TypeAnalyzerErrors` This is part of a larger arc of work to change the analyzer's use of the shared code so that the type parameters it supplies are not part of the analyzer public API. See #59763. Change-Id: I3c8c3b1daf2dc6fbf03024d436e800fefc78bee4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403260 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent a56b0d6 commit f023483

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SharedTypeAnalyzerErrors
2727
ExpressionImpl,
2828
PromotableElementImpl2,
2929
SharedTypeView<DartType>,
30-
DartPattern,
30+
DartPatternImpl,
3131
void> {
3232
final ErrorReporter _errorReporter;
3333

pkg/analyzer/lib/src/generated/resolver.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ import 'package:analyzer/src/utilities/extensions/object.dart';
9898
bool Function(Source) inferenceLoggingPredicate = (_) => false;
9999

100100
typedef SharedMatchContext = shared.MatchContext<AstNode, ExpressionImpl,
101-
DartPattern, SharedTypeView<DartType>, PromotableElementImpl2>;
101+
DartPatternImpl, SharedTypeView<DartType>, PromotableElementImpl2>;
102102

103103
typedef SharedPatternField
104104
= shared.RecordPatternField<PatternFieldImpl, DartPatternImpl>;
@@ -126,7 +126,7 @@ class ResolverVisitor extends ThrowingAstVisitor<void>
126126
StatementImpl,
127127
ExpressionImpl,
128128
PromotableElementImpl2,
129-
DartPattern,
129+
DartPatternImpl,
130130
void,
131131
TypeParameterElementImpl2,
132132
InterfaceTypeImpl,
@@ -936,7 +936,7 @@ class ResolverVisitor extends ThrowingAstVisitor<void>
936936
}
937937

938938
@override
939-
shared.MapPatternEntry<ExpressionImpl, DartPattern>? getMapPatternEntry(
939+
shared.MapPatternEntry<ExpressionImpl, DartPatternImpl>? getMapPatternEntry(
940940
covariant MapPatternElementImpl element,
941941
) {
942942
if (element is MapPatternEntryImpl) {
@@ -970,7 +970,7 @@ class ResolverVisitor extends ThrowingAstVisitor<void>
970970
}
971971

972972
@override
973-
DartPattern? getRestPatternElementPattern(
973+
DartPatternImpl? getRestPatternElementPattern(
974974
covariant RestPatternElementImpl element,
975975
) {
976976
return element.pattern;

0 commit comments

Comments
 (0)