Files
sdk/pkg/scrape/example/generic_classes.dart
T
Nate Bosch 6c104e4fcf Remove an unnecessary override
It is not necessary to have an override which only forwards to the super
implementation. This surfaces as a diagnostic that causes test failures.

Change-Id: I46bff26933e0b546e8072b175e6cce7dc7c14c09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266761
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2022-10-31 20:30:47 +00:00

26 lines
801 B
Dart

// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/ast/ast.dart';
import 'package:scrape/scrape.dart';
void main(List<String> arguments) {
Scrape()
..addHistogram('Classes', order: SortOrder.numeric)
..addVisitor(() => GenericClassVisitor())
..runCommandLine(arguments);
}
class GenericClassVisitor extends ScrapeVisitor {
@override
void visitClassDeclaration(ClassDeclaration node) {
if (node.typeParameters == null) {
record('Classes', 0);
} else {
record('Classes', node.typeParameters!.typeParameters.length);
}
super.visitClassDeclaration(node);
}
}