[kerne] Remove type parameter from RecursiveVisitor
The type parameter was a left-over from a pre-nnbd encoding of the visitors, but Flutter dependency on the code prevented its removal. TEST=existing Change-Id: I02657a469290f169077faa1167cf59b75de13c9c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350840 Reviewed-by: Mayank Patke <fishythefish@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Jens Johansen <jensj@google.com>
This commit is contained in:
committed by
Commit Queue
parent
1af1f2ea8d
commit
6e4674d445
@@ -1774,7 +1774,7 @@ class LocalFunctionInfo {
|
||||
get disambiguatedName => order == 0 ? name : '$name%${order - 1}';
|
||||
}
|
||||
|
||||
class LocalFunctionInfoCollector extends ir.RecursiveVisitor<void> {
|
||||
class LocalFunctionInfoCollector extends ir.RecursiveVisitor {
|
||||
final localFunctions = <ir.LocalFunction, LocalFunctionInfo>{};
|
||||
final localFunctionNameCount = <String, int>{};
|
||||
|
||||
|
||||
@@ -557,7 +557,7 @@ class _RecordClassGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
class _RecordVisitor extends RecursiveVisitor<void> {
|
||||
class _RecordVisitor extends RecursiveVisitor {
|
||||
final _RecordClassGenerator classGenerator;
|
||||
final Set<Constant> constantCache = Set.identity();
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ bool hasLabeledContinue(SwitchStatement node) {
|
||||
return visitor.found;
|
||||
}
|
||||
|
||||
class LabelContinueFinder extends RecursiveVisitor<void> {
|
||||
class LabelContinueFinder extends RecursiveVisitor {
|
||||
var found = false;
|
||||
|
||||
void visit(Statement? s) {
|
||||
@@ -309,7 +309,7 @@ bool containsFunctionExpression(Node n) {
|
||||
return visitor.found;
|
||||
}
|
||||
|
||||
class _FunctionExpressionFinder extends RecursiveVisitor<void> {
|
||||
class _FunctionExpressionFinder extends RecursiveVisitor {
|
||||
var found = false;
|
||||
|
||||
static final instance = _FunctionExpressionFinder();
|
||||
@@ -345,7 +345,7 @@ bool _isDartInternal(Uri uri) =>
|
||||
|
||||
/// Collects all `TypeParameter`s from the `TypeParameterType`s present in the
|
||||
/// visited `DartType`.
|
||||
class TypeParameterFinder extends RecursiveVisitor<void> {
|
||||
class TypeParameterFinder extends RecursiveVisitor {
|
||||
final _found = <TypeParameter>{};
|
||||
static TypeParameterFinder? _instance;
|
||||
|
||||
@@ -367,7 +367,7 @@ class TypeParameterFinder extends RecursiveVisitor<void> {
|
||||
}
|
||||
|
||||
/// Collects [InterfaceType] nodes that appear in in a DartType.
|
||||
class InterfaceTypeExtractor extends RecursiveVisitor<DartType> {
|
||||
class InterfaceTypeExtractor extends RecursiveVisitor {
|
||||
final Set<InterfaceType> _found = {};
|
||||
|
||||
@override
|
||||
|
||||
@@ -37,7 +37,7 @@ void main(List<String> args) {
|
||||
}
|
||||
}
|
||||
|
||||
class UnreachableIfFinder extends RecursiveVisitor<void> {
|
||||
class UnreachableIfFinder extends RecursiveVisitor {
|
||||
static List<Warning> find(Component c) {
|
||||
EffectivelyFinal effectivelyFinal = new EffectivelyFinal._();
|
||||
c.accept(effectivelyFinal);
|
||||
@@ -116,7 +116,7 @@ class UnreachableIfFinder extends RecursiveVisitor<void> {
|
||||
}
|
||||
}
|
||||
|
||||
class EffectivelyFinal extends RecursiveVisitor<void> {
|
||||
class EffectivelyFinal extends RecursiveVisitor {
|
||||
final Set<VariableDeclaration> unwritten = {};
|
||||
|
||||
EffectivelyFinal._();
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'dart:collection';
|
||||
|
||||
import 'kernel.dart';
|
||||
|
||||
class _ConstVisitor extends RecursiveVisitor<void> {
|
||||
class _ConstVisitor extends RecursiveVisitor {
|
||||
_ConstVisitor(
|
||||
this.classLibraryUri,
|
||||
this.className,
|
||||
|
||||
@@ -1717,9 +1717,7 @@ mixin VisitorDefaultValueMixin<R> implements VisitorDefault<R> {
|
||||
}
|
||||
|
||||
/// Recursive visitor that doesn't return anything from its visit methods.
|
||||
// TODO(johnniwinther): Remove type parameter when all subclasses have been
|
||||
// changed to use [RecursiveVisitor] without type arguments.
|
||||
class RecursiveVisitor<T> extends VisitorDefault<void> with VisitorVoidMixin {
|
||||
class RecursiveVisitor extends VisitorDefault<void> with VisitorVoidMixin {
|
||||
const RecursiveVisitor();
|
||||
|
||||
@override
|
||||
|
||||
@@ -46,7 +46,7 @@ class ClosureIdMetadataRepository extends MetadataRepository<int> {
|
||||
}
|
||||
}
|
||||
|
||||
class _ClosureIndexer extends RecursiveVisitor<void> {
|
||||
class _ClosureIndexer extends RecursiveVisitor {
|
||||
// Zero is reserved for tear-offs.
|
||||
static int firstClosureIndex = 1;
|
||||
|
||||
|
||||
@@ -594,7 +594,7 @@ mixin FinalizableTransformer on Transformer {
|
||||
///
|
||||
/// We cannot use the precomputed scopes for their declarations, because we
|
||||
/// could see returns in a scope before a declaration.
|
||||
class FindCaptures extends RecursiveVisitor<void> {
|
||||
class FindCaptures extends RecursiveVisitor {
|
||||
final bool Function(DartType) _isFinalizable;
|
||||
|
||||
final bool thisIsFinalizable;
|
||||
|
||||
@@ -51,7 +51,7 @@ String _toJson(List<Identifier> identifiers) {
|
||||
});
|
||||
}
|
||||
|
||||
class _ResourceIdentifierVisitor extends RecursiveVisitor<void> {
|
||||
class _ResourceIdentifierVisitor extends RecursiveVisitor {
|
||||
final List<Identifier> identifiers = [];
|
||||
final List<LoadingUnit> _loadingUnits;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user