| Index: pkg/analyzer/lib/src/task/strong_mode.dart
|
| diff --git a/pkg/analyzer/lib/src/task/strong_mode.dart b/pkg/analyzer/lib/src/task/strong_mode.dart
|
| index 3d13146065a5344d93801fdf710494630f757e27..a78d590f344a6403c06ab3b52cb26763f5fc0579 100644
|
| --- a/pkg/analyzer/lib/src/task/strong_mode.dart
|
| +++ b/pkg/analyzer/lib/src/task/strong_mode.dart
|
| @@ -83,83 +83,6 @@ ParameterElement _getParameter(ExecutableElement setter) {
|
| typedef bool VariableFilter(VariableElement element);
|
|
|
| /**
|
| - * An object used to find static variables whose types should be inferred and
|
| - * classes whose members should have types inferred. Clients are expected to
|
| - * visit a [CompilationUnit].
|
| - */
|
| -class InferrenceFinder extends SimpleAstVisitor {
|
| - /**
|
| - * The static variables that should have types inferred for them.
|
| - */
|
| - final List<VariableElement> staticVariables = <VariableElement>[];
|
| -
|
| - /**
|
| - * The classes defined in the unit.
|
| - *
|
| - * TODO(brianwilkerson) We don't currently remove classes whose members do not
|
| - * need to be processed, but we potentially could.
|
| - */
|
| - final List<ClassElement> classes = <ClassElement>[];
|
| -
|
| - /**
|
| - * Initialize a newly created finder.
|
| - */
|
| - InferrenceFinder();
|
| -
|
| - @override
|
| - void visitClassDeclaration(ClassDeclaration node) {
|
| - classes.add(node.element);
|
| - for (ClassMember member in node.members) {
|
| - member.accept(this);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void visitClassTypeAlias(ClassTypeAlias node) {
|
| - classes.add(node.element);
|
| - }
|
| -
|
| - @override
|
| - void visitCompilationUnit(CompilationUnit node) {
|
| - for (CompilationUnitMember declaration in node.declarations) {
|
| - declaration.accept(this);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void visitFieldDeclaration(FieldDeclaration node) {
|
| - if (node.isStatic && node.fields.type == null) {
|
| - _addVariables(node.fields.variables);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
|
| - if (node.variables.type == null) {
|
| - _addVariables(node.variables.variables);
|
| - }
|
| - }
|
| -
|
| - /**
|
| - * Add all of the [variables] with initializers to the list of variables whose
|
| - * type can be inferred. Technically, we only infer the types of variables
|
| - * that do not have a static type, but all variables with initializers
|
| - * potentially need to be re-resolved after inference because they might
|
| - * refer to fields whose type was inferred.
|
| - */
|
| - void _addVariables(NodeList<VariableDeclaration> variables) {
|
| - for (VariableDeclaration variable in variables) {
|
| - if (variable.initializer != null) {
|
| - VariableElement element = variable.element;
|
| - if (element.hasImplicitType) {
|
| - staticVariables.add(element);
|
| - }
|
| - }
|
| - }
|
| - }
|
| -}
|
| -
|
| -/**
|
| * An object used to infer the type of instance fields and the return types of
|
| * instance methods within a single compilation unit.
|
| */
|
| @@ -416,7 +339,7 @@ class InstanceMemberInferrer {
|
| (fieldElement as FieldElementImpl).type = newType;
|
| setReturnType(fieldElement.getter, newType);
|
| if (!fieldElement.isFinal && !fieldElement.isConst) {
|
| - setParameterType(fieldElement.setter, newType);
|
| + setParameterType(fieldElement.setter, newType);
|
| }
|
| }
|
| }
|
|
|