| Index: pkg/analyzer/lib/src/generated/resolver.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
|
| index 0d20c8b1c7b4dbb7081d8dcfc2cfcab0126cc129..9c12b2dd44d7fae34a272c75e58ca124b4584c9b 100644
|
| --- a/pkg/analyzer/lib/src/generated/resolver.dart
|
| +++ b/pkg/analyzer/lib/src/generated/resolver.dart
|
| @@ -4568,7 +4568,9 @@ class GatherUsedLocalElementsVisitor extends RecursiveAstVisitor {
|
| if (parent2 is IsExpression) {
|
| return;
|
| }
|
| - if (parent2 is VariableDeclarationList) {
|
| + // We need to instantiate/extend/implement a class to actually use it.
|
| + // OTOH, function type aliases are used to define closure structures.
|
| + if (parent2 is VariableDeclarationList && element is ClassElement) {
|
| return;
|
| }
|
| }
|
| @@ -14907,6 +14909,17 @@ class UnusedLocalElementsVerifier extends RecursiveElementVisitor {
|
| }
|
|
|
| @override
|
| + visitFunctionTypeAliasElement(FunctionTypeAliasElement element) {
|
| + if (!_isUsedElement(element)) {
|
| + _reportErrorForElement(HintCode.UNUSED_ELEMENT, element, [
|
| + element.kind.displayName,
|
| + element.displayName
|
| + ]);
|
| + }
|
| + super.visitFunctionTypeAliasElement(element);
|
| + }
|
| +
|
| + @override
|
| visitLocalVariableElement(LocalVariableElement element) {
|
| if (!_isUsedElement(element) && !_isNamedUnderscore(element)) {
|
| HintCode errorCode;
|
|
|