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 b221f9ffb3ab9d4004f5d0fc08f51845b8b13a4e..a9c8edb48357aef9e0a681a0409fdcd7f43581b1 100644 |
--- a/pkg/analyzer/lib/src/generated/resolver.dart |
+++ b/pkg/analyzer/lib/src/generated/resolver.dart |
@@ -4922,7 +4922,10 @@ class GatherUsedLocalElementsVisitor extends RecursiveAstVisitor { |
return; |
} |
if (parent2 is VariableDeclarationList) { |
- return; |
+ // If it's a field's type, it still counts as used. |
+ if (parent2.parent is! FieldDeclaration) { |
+ return; |
+ } |
} |
} |
} |