Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: pkg/analyzer_experimental/lib/src/generated/resolver.dart

Issue 16611004: Improve java2dart code style - relax 'don't reference variable name in its initializer'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer_experimental/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer_experimental/lib/src/generated/resolver.dart b/pkg/analyzer_experimental/lib/src/generated/resolver.dart
index c20fe3818f0d3c854f1a13832e766b182115153c..abc4eb0d9babdf2534d28420641b6833b556bd55 100644
--- a/pkg/analyzer_experimental/lib/src/generated/resolver.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/resolver.dart
@@ -94,16 +94,16 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
return null;
}
Object visitCatchClause(CatchClause node) {
- SimpleIdentifier exceptionParameter2 = node.exceptionParameter;
- if (exceptionParameter2 != null) {
- LocalVariableElementImpl exception = new LocalVariableElementImpl(exceptionParameter2);
+ SimpleIdentifier exceptionParameter = node.exceptionParameter;
+ if (exceptionParameter != null) {
+ LocalVariableElementImpl exception = new LocalVariableElementImpl(exceptionParameter);
_currentHolder.addLocalVariable(exception);
- exceptionParameter2.element = exception;
- SimpleIdentifier stackTraceParameter2 = node.stackTraceParameter;
- if (stackTraceParameter2 != null) {
- LocalVariableElementImpl stackTrace = new LocalVariableElementImpl(stackTraceParameter2);
+ exceptionParameter.element = exception;
+ SimpleIdentifier stackTraceParameter = node.stackTraceParameter;
+ if (stackTraceParameter != null) {
+ LocalVariableElementImpl stackTrace = new LocalVariableElementImpl(stackTraceParameter);
_currentHolder.addLocalVariable(stackTrace);
- stackTraceParameter2.element = stackTrace;
+ stackTraceParameter.element = stackTrace;
}
}
return super.visitCatchClause(node);
@@ -114,20 +114,20 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
visitChildren(holder, node);
SimpleIdentifier className = node.name;
ClassElementImpl element = new ClassElementImpl(className);
- List<TypeVariableElement> typeVariables2 = holder.typeVariables;
+ List<TypeVariableElement> typeVariables = holder.typeVariables;
InterfaceTypeImpl interfaceType = new InterfaceTypeImpl.con1(element);
- interfaceType.typeArguments = createTypeVariableTypes(typeVariables2);
+ interfaceType.typeArguments = createTypeVariableTypes(typeVariables);
element.type = interfaceType;
- List<ConstructorElement> constructors2 = holder.constructors;
- if (constructors2.length == 0) {
- constructors2 = createDefaultConstructors(interfaceType);
+ List<ConstructorElement> constructors = holder.constructors;
+ if (constructors.length == 0) {
+ constructors = createDefaultConstructors(interfaceType);
}
element.abstract = node.abstractKeyword != null;
element.accessors = holder.accessors;
- element.constructors = constructors2;
+ element.constructors = constructors;
element.fields = holder.fields;
element.methods = holder.methods;
- element.typeVariables = typeVariables2;
+ element.typeVariables = typeVariables;
element.validMixin = _isValidMixin;
_currentHolder.addType(element);
className.element = element;
@@ -140,10 +140,10 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
ClassElementImpl element = new ClassElementImpl(className);
element.abstract = node.abstractKeyword != null;
element.typedef = true;
- List<TypeVariableElement> typeVariables2 = holder.typeVariables;
- element.typeVariables = typeVariables2;
+ List<TypeVariableElement> typeVariables = holder.typeVariables;
+ element.typeVariables = typeVariables;
InterfaceTypeImpl interfaceType = new InterfaceTypeImpl.con1(element);
- interfaceType.typeArguments = createTypeVariableTypes(typeVariables2);
+ interfaceType.typeArguments = createTypeVariableTypes(typeVariables);
element.type = interfaceType;
element.constructors = createDefaultConstructors(interfaceType);
_currentHolder.addType(element);
@@ -173,9 +173,9 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
_currentHolder.addConstructor(element);
node.element = element;
if (constructorName == null) {
- Identifier returnType2 = node.returnType;
- if (returnType2 != null) {
- element.nameOffset = returnType2.offset;
+ Identifier returnType = node.returnType;
+ if (returnType != null) {
+ element.nameOffset = returnType.offset;
}
} else {
constructorName.element = element;
@@ -184,14 +184,14 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
}
Object visitDeclaredIdentifier(DeclaredIdentifier node) {
SimpleIdentifier variableName = node.identifier;
- sc.Token keyword2 = node.keyword;
+ sc.Token keyword = node.keyword;
LocalVariableElementImpl element = new LocalVariableElementImpl(variableName);
ForEachStatement statement = node.parent as ForEachStatement;
int declarationEnd = node.offset + node.length;
int statementEnd = statement.offset + statement.length;
element.setVisibleRange(declarationEnd, statementEnd - declarationEnd - 1);
- element.const3 = matches(keyword2, sc.Keyword.CONST);
- element.final2 = matches(keyword2, sc.Keyword.FINAL);
+ element.const3 = matches(keyword, sc.Keyword.CONST);
+ element.final2 = matches(keyword, sc.Keyword.FINAL);
_currentHolder.addLocalVariable(element);
variableName.element = element;
return super.visitDeclaredIdentifier(node);
@@ -346,13 +346,13 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
ElementHolder holder = new ElementHolder();
visitChildren(holder, node);
SimpleIdentifier aliasName = node.name;
- List<ParameterElement> parameters2 = holder.parameters;
- List<TypeVariableElement> typeVariables2 = holder.typeVariables;
+ List<ParameterElement> parameters = holder.parameters;
+ List<TypeVariableElement> typeVariables = holder.typeVariables;
FunctionTypeAliasElementImpl element = new FunctionTypeAliasElementImpl(aliasName);
- element.parameters = parameters2;
- element.typeVariables = typeVariables2;
+ element.parameters = parameters;
+ element.typeVariables = typeVariables;
FunctionTypeImpl type = new FunctionTypeImpl.con2(element);
- type.typeArguments = createTypeVariableTypes(typeVariables2);
+ type.typeArguments = createTypeVariableTypes(typeVariables);
element.type = type;
_currentHolder.addTypeAlias(element);
aliasName.element = element;
@@ -390,7 +390,7 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
} finally {
_inFunction = wasInFunction;
}
- bool isStatic2 = node.isStatic();
+ bool isStatic = node.isStatic();
sc.Token property = node.propertyKeyword;
if (property == null) {
SimpleIdentifier methodName = node.name;
@@ -404,7 +404,7 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
element.labels = holder.labels;
element.localVariables = holder.localVariables;
element.parameters = holder.parameters;
- element.static = isStatic2;
+ element.static = isStatic;
_currentHolder.addMethod(element);
methodName.element = element;
} else {
@@ -414,7 +414,7 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
if (field == null) {
field = new FieldElementImpl.con2(node.name.name);
field.final2 = true;
- field.static = isStatic2;
+ field.static = isStatic;
_currentHolder.addField(field);
}
if (matches(property, sc.Keyword.GET)) {
@@ -425,7 +425,7 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
getter.variable = field;
getter.abstract = node.body is EmptyFunctionBody && node.externalKeyword == null;
getter.getter = true;
- getter.static = isStatic2;
+ getter.static = isStatic;
field.getter = getter;
_currentHolder.addAccessor(getter);
propertyNameNode.element = getter;
@@ -438,7 +438,7 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
setter.variable = field;
setter.abstract = node.body is EmptyFunctionBody && !matches(node.externalKeyword, sc.Keyword.EXTERNAL);
setter.setter = true;
- setter.static = isStatic2;
+ setter.static = isStatic;
field.setter = setter;
field.final2 = false;
_currentHolder.addAccessor(setter);
@@ -491,9 +491,9 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
return super.visitTypeParameter(node);
}
Object visitVariableDeclaration(VariableDeclaration node) {
- sc.Token keyword2 = ((node.parent as VariableDeclarationList)).keyword;
- bool isConst = matches(keyword2, sc.Keyword.CONST);
- bool isFinal = matches(keyword2, sc.Keyword.FINAL);
+ sc.Token keyword = ((node.parent as VariableDeclarationList)).keyword;
+ bool isConst = matches(keyword, sc.Keyword.CONST);
+ bool isFinal = matches(keyword, sc.Keyword.FINAL);
bool hasInitializer = node.initializer != null;
VariableElementImpl element;
if (_inFieldContext) {
@@ -605,14 +605,14 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
* @return the body of the function that contains the given parameter
*/
FunctionBody getFunctionBody(FormalParameter node) {
- ASTNode parent2 = node.parent;
- while (parent2 != null) {
- if (parent2 is FunctionExpression) {
- return ((parent2 as FunctionExpression)).body;
- } else if (parent2 is MethodDeclaration) {
- return ((parent2 as MethodDeclaration)).body;
+ ASTNode parent = node.parent;
+ while (parent != null) {
+ if (parent is FunctionExpression) {
+ return ((parent as FunctionExpression)).body;
+ } else if (parent is MethodDeclaration) {
+ return ((parent as MethodDeclaration)).body;
}
- parent2 = parent2.parent;
+ parent = parent.parent;
}
return null;
}
@@ -929,15 +929,15 @@ class HtmlUnitBuilder implements ht.XmlVisitor<Object> {
if (identical(node.attributeEnd.type, ht.TokenType.GT) && scriptSourcePath == null) {
EmbeddedHtmlScriptElementImpl script = new EmbeddedHtmlScriptElementImpl(node);
String contents = node.content;
- int attributeEnd2 = node.attributeEnd.end;
- LineInfo_Location location = _lineInfo.getLocation(attributeEnd2);
+ int attributeEnd = node.attributeEnd.end;
+ LineInfo_Location location = _lineInfo.getLocation(attributeEnd);
sc.StringScanner scanner = new sc.StringScanner(htmlSource, contents, _errorListener);
- scanner.setSourceStart(location.lineNumber, location.columnNumber, attributeEnd2);
+ scanner.setSourceStart(location.lineNumber, location.columnNumber, attributeEnd);
sc.Token firstToken = scanner.tokenize();
- List<int> lineStarts2 = scanner.lineStarts;
+ List<int> lineStarts = scanner.lineStarts;
Parser parser = new Parser(htmlSource, _errorListener);
CompilationUnit unit = parser.parseCompilationUnit(firstToken);
- unit.lineInfo = new LineInfo(lineStarts2);
+ unit.lineInfo = new LineInfo(lineStarts);
try {
LibraryResolver resolver = new LibraryResolver(_context);
LibraryElementImpl library = resolver.resolveEmbeddedLibrary(htmlSource, unit, true) as LibraryElementImpl;
@@ -1069,13 +1069,13 @@ class DeclarationResolver extends RecursiveASTVisitor<Object> {
unit.accept(this);
}
Object visitCatchClause(CatchClause node) {
- SimpleIdentifier exceptionParameter2 = node.exceptionParameter;
- if (exceptionParameter2 != null) {
- List<LocalVariableElement> localVariables2 = _enclosingExecutable.localVariables;
- find3(localVariables2, exceptionParameter2);
- SimpleIdentifier stackTraceParameter2 = node.stackTraceParameter;
- if (stackTraceParameter2 != null) {
- find3(localVariables2, stackTraceParameter2);
+ SimpleIdentifier exceptionParameter = node.exceptionParameter;
+ if (exceptionParameter != null) {
+ List<LocalVariableElement> localVariables = _enclosingExecutable.localVariables;
+ find3(localVariables, exceptionParameter);
+ SimpleIdentifier stackTraceParameter = node.stackTraceParameter;
+ if (stackTraceParameter != null) {
+ find3(localVariables, stackTraceParameter);
}
}
return super.visitCatchClause(node);
@@ -1131,23 +1131,23 @@ class DeclarationResolver extends RecursiveASTVisitor<Object> {
writer.println("Invalid state found in the Analysis Engine:");
writer.println("DeclarationResolver.visitDefaultFormalParameter() is visiting a parameter that does not appear to be in a method or function.");
writer.println("Ancestors:");
- ASTNode parent2 = node.parent;
- while (parent2 != null) {
- writer.println(parent2.runtimeType.toString());
+ ASTNode parent = node.parent;
+ while (parent != null) {
+ writer.println(parent.runtimeType.toString());
writer.println("---------");
- parent2 = parent2.parent;
+ parent = parent.parent;
}
AnalysisEngine.instance.logger.logError2(writer.toString(), new AnalysisException());
}
- Expression defaultValue2 = node.defaultValue;
- if (defaultValue2 != null) {
+ Expression defaultValue = node.defaultValue;
+ if (defaultValue != null) {
ExecutableElement outerExecutable = _enclosingExecutable;
try {
if (element == null) {
} else {
_enclosingExecutable = element.initializer;
}
- defaultValue2.accept(this);
+ defaultValue.accept(this);
} finally {
_enclosingExecutable = outerExecutable;
}
@@ -1161,10 +1161,10 @@ class DeclarationResolver extends RecursiveASTVisitor<Object> {
}
}
Object visitExportDirective(ExportDirective node) {
- String uri2 = getStringValue(node.uri);
- if (uri2 != null) {
- LibraryElement library2 = _enclosingUnit.library;
- ExportElement exportElement = find5(library2.exports, _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri2));
+ String uri = getStringValue(node.uri);
+ if (uri != null) {
+ LibraryElement library = _enclosingUnit.library;
+ ExportElement exportElement = find5(library.exports, _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri));
node.element = exportElement;
}
return super.visitExportDirective(node);
@@ -1248,10 +1248,10 @@ class DeclarationResolver extends RecursiveASTVisitor<Object> {
}
}
Object visitImportDirective(ImportDirective node) {
- String uri2 = getStringValue(node.uri);
- if (uri2 != null) {
- LibraryElement library2 = _enclosingUnit.library;
- ImportElement importElement = find6(library2.imports, _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri2), node.prefix);
+ String uri = getStringValue(node.uri);
+ if (uri != null) {
+ LibraryElement library = _enclosingUnit.library;
+ ImportElement importElement = find6(library.imports, _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri), node.prefix);
node.element = importElement;
}
return super.visitImportDirective(node);
@@ -1293,9 +1293,9 @@ class DeclarationResolver extends RecursiveASTVisitor<Object> {
}
}
Object visitPartDirective(PartDirective node) {
- String uri2 = getStringValue(node.uri);
- if (uri2 != null) {
- Source partSource = _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri2);
+ String uri = getStringValue(node.uri);
+ if (uri != null) {
+ Source partSource = _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri);
node.element = find(_enclosingUnit.library.parts, partSource);
}
return super.visitPartDirective(node);
@@ -1362,8 +1362,8 @@ class DeclarationResolver extends RecursiveASTVisitor<Object> {
if (element == null && _enclosingUnit != null) {
element = find3(_enclosingUnit.topLevelVariables, variableName);
}
- Expression initializer2 = node.initializer;
- if (initializer2 != null) {
+ Expression initializer = node.initializer;
+ if (initializer != null) {
ExecutableElement outerExecutable = _enclosingExecutable;
try {
if (element == null) {
@@ -1567,9 +1567,9 @@ class ElementResolver extends SimpleASTVisitor<Object> {
* @return {@code true} if the given identifier is the return type of a constructor declaration.
*/
static bool isConstructorReturnType(SimpleIdentifier node) {
- ASTNode parent2 = node.parent;
- if (parent2 is ConstructorDeclaration) {
- ConstructorDeclaration constructor = parent2 as ConstructorDeclaration;
+ ASTNode parent = node.parent;
+ if (parent is ConstructorDeclaration) {
+ ConstructorDeclaration constructor = parent as ConstructorDeclaration;
return identical(constructor.returnType, node);
}
return false;
@@ -1580,9 +1580,9 @@ class ElementResolver extends SimpleASTVisitor<Object> {
* declaration.
*/
static bool isFactoryConstructorReturnType(SimpleIdentifier node) {
- ASTNode parent2 = node.parent;
- if (parent2 is ConstructorDeclaration) {
- ConstructorDeclaration constructor = parent2 as ConstructorDeclaration;
+ ASTNode parent = node.parent;
+ if (parent is ConstructorDeclaration) {
+ ConstructorDeclaration constructor = parent as ConstructorDeclaration;
return identical(constructor.returnType, node) && constructor.factoryKeyword != null;
}
return false;
@@ -1645,40 +1645,40 @@ class ElementResolver extends SimpleASTVisitor<Object> {
_strictMode = resolver.definingLibrary.context.analysisOptions.strictMode;
}
Object visitAssignmentExpression(AssignmentExpression node) {
- sc.Token operator2 = node.operator;
- sc.TokenType operatorType = operator2.type;
+ sc.Token operator = node.operator;
+ sc.TokenType operatorType = operator.type;
if (operatorType != sc.TokenType.EQ) {
operatorType = operatorFromCompoundAssignment(operatorType);
- Expression leftHandSide2 = node.leftHandSide;
- if (leftHandSide2 != null) {
+ Expression leftHandSide = node.leftHandSide;
+ if (leftHandSide != null) {
String methodName = operatorType.lexeme;
- Type2 staticType = getStaticType(leftHandSide2);
- MethodElement staticMethod = lookUpMethod(leftHandSide2, staticType, methodName);
+ Type2 staticType = getStaticType(leftHandSide);
+ MethodElement staticMethod = lookUpMethod(leftHandSide, staticType, methodName);
node.staticElement = staticMethod;
- Type2 propagatedType = getPropagatedType(leftHandSide2);
- MethodElement propagatedMethod = lookUpMethod(leftHandSide2, propagatedType, methodName);
+ Type2 propagatedType = getPropagatedType(leftHandSide);
+ MethodElement propagatedMethod = lookUpMethod(leftHandSide, propagatedType, methodName);
node.element = select3(staticMethod, propagatedMethod);
if (shouldReportMissingMember(staticType, staticMethod) && (_strictMode || propagatedType == null || shouldReportMissingMember(propagatedType, propagatedMethod))) {
- _resolver.reportError6(StaticTypeWarningCode.UNDEFINED_METHOD, operator2, [methodName, staticType.displayName]);
+ _resolver.reportError6(StaticTypeWarningCode.UNDEFINED_METHOD, operator, [methodName, staticType.displayName]);
}
}
}
return null;
}
Object visitBinaryExpression(BinaryExpression node) {
- sc.Token operator2 = node.operator;
- if (operator2.isUserDefinableOperator()) {
- Expression leftOperand2 = node.leftOperand;
- if (leftOperand2 != null) {
- String methodName = operator2.lexeme;
- Type2 staticType = getStaticType(leftOperand2);
- MethodElement staticMethod = lookUpMethod(leftOperand2, staticType, methodName);
+ sc.Token operator = node.operator;
+ if (operator.isUserDefinableOperator()) {
+ Expression leftOperand = node.leftOperand;
+ if (leftOperand != null) {
+ String methodName = operator.lexeme;
+ Type2 staticType = getStaticType(leftOperand);
+ MethodElement staticMethod = lookUpMethod(leftOperand, staticType, methodName);
node.staticElement = staticMethod;
- Type2 propagatedType = getPropagatedType(leftOperand2);
- MethodElement propagatedMethod = lookUpMethod(leftOperand2, propagatedType, methodName);
+ Type2 propagatedType = getPropagatedType(leftOperand);
+ MethodElement propagatedMethod = lookUpMethod(leftOperand, propagatedType, methodName);
node.element = select3(staticMethod, propagatedMethod);
if (shouldReportMissingMember(staticType, staticMethod) && (_strictMode || propagatedType == null || shouldReportMissingMember(propagatedType, propagatedMethod))) {
- _resolver.reportError6(StaticTypeWarningCode.UNDEFINED_OPERATOR, operator2, [methodName, staticType.displayName]);
+ _resolver.reportError6(StaticTypeWarningCode.UNDEFINED_OPERATOR, operator, [methodName, staticType.displayName]);
}
}
}
@@ -1701,9 +1701,9 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return null;
}
Object visitCommentReference(CommentReference node) {
- Identifier identifier2 = node.identifier;
- if (identifier2 is SimpleIdentifier) {
- SimpleIdentifier simpleIdentifier = identifier2 as SimpleIdentifier;
+ Identifier identifier = node.identifier;
+ if (identifier is SimpleIdentifier) {
+ SimpleIdentifier simpleIdentifier = identifier as SimpleIdentifier;
Element element = resolveSimpleIdentifier(simpleIdentifier);
if (element == null) {
element = findImportWithoutPrefix(simpleIdentifier);
@@ -1727,23 +1727,23 @@ class ElementResolver extends SimpleASTVisitor<Object> {
}
}
}
- } else if (identifier2 is PrefixedIdentifier) {
- PrefixedIdentifier prefixedIdentifier = identifier2 as PrefixedIdentifier;
- SimpleIdentifier prefix2 = prefixedIdentifier.prefix;
+ } else if (identifier is PrefixedIdentifier) {
+ PrefixedIdentifier prefixedIdentifier = identifier as PrefixedIdentifier;
+ SimpleIdentifier prefix = prefixedIdentifier.prefix;
SimpleIdentifier name = prefixedIdentifier.identifier;
- Element element = resolveSimpleIdentifier(prefix2);
+ Element element = resolveSimpleIdentifier(prefix);
if (element == null) {
} else {
if (element is PrefixElement) {
- recordResolution(prefix2, element);
- element = _resolver.nameScope.lookup(identifier2, _resolver.definingLibrary);
+ recordResolution(prefix, element);
+ element = _resolver.nameScope.lookup(identifier, _resolver.definingLibrary);
recordResolution(name, element);
return null;
}
- LibraryElement library2 = element.library;
- if (library2 == null) {
+ LibraryElement library = element.library;
+ if (library == null) {
AnalysisEngine.instance.logger.logError("Found element with null library: ${element.name}");
- } else if (library2 != _resolver.definingLibrary) {
+ } else if (library != _resolver.definingLibrary) {
}
recordResolution(name, element);
if (node.newKeyword == null) {
@@ -1752,7 +1752,7 @@ class ElementResolver extends SimpleASTVisitor<Object> {
if (memberElement == null) {
memberElement = ((element as ClassElement)).getNamedConstructor(name.name);
if (memberElement == null) {
- memberElement = lookUpSetter(prefix2, ((element as ClassElement)).type, name.name);
+ memberElement = lookUpSetter(prefix, ((element as ClassElement)).type, name.name);
}
}
if (memberElement == null) {
@@ -1777,9 +1777,9 @@ class ElementResolver extends SimpleASTVisitor<Object> {
}
Object visitConstructorDeclaration(ConstructorDeclaration node) {
super.visitConstructorDeclaration(node);
- ConstructorElement element2 = node.element;
- if (element2 is ConstructorElementImpl) {
- ConstructorElementImpl constructorElement = element2 as ConstructorElementImpl;
+ ConstructorElement element = node.element;
+ if (element is ConstructorElementImpl) {
+ ConstructorElementImpl constructorElement = element as ConstructorElementImpl;
ConstructorName redirectedNode = node.redirectedConstructor;
if (redirectedNode != null) {
ConstructorElement redirectedElement = redirectedNode.element;
@@ -1796,25 +1796,25 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return null;
}
Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
- SimpleIdentifier fieldName2 = node.fieldName;
- ClassElement enclosingClass2 = _resolver.enclosingClass;
- FieldElement fieldElement = ((enclosingClass2 as ClassElementImpl)).getField(fieldName2.name);
- recordResolution(fieldName2, fieldElement);
+ SimpleIdentifier fieldName = node.fieldName;
+ ClassElement enclosingClass = _resolver.enclosingClass;
+ FieldElement fieldElement = ((enclosingClass as ClassElementImpl)).getField(fieldName.name);
+ recordResolution(fieldName, fieldElement);
if (fieldElement == null || fieldElement.isSynthetic()) {
- _resolver.reportError(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTANT_FIELD, node, [fieldName2]);
+ _resolver.reportError(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTANT_FIELD, node, [fieldName]);
} else if (fieldElement.isStatic()) {
- _resolver.reportError(CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, node, [fieldName2]);
+ _resolver.reportError(CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, node, [fieldName]);
}
return null;
}
Object visitConstructorName(ConstructorName node) {
- Type2 type2 = node.type.type;
- if (type2 != null && type2.isDynamic()) {
+ Type2 type = node.type.type;
+ if (type != null && type.isDynamic()) {
return null;
- } else if (type2 is! InterfaceType) {
- ASTNode parent2 = node.parent;
- if (parent2 is InstanceCreationExpression) {
- if (((parent2 as InstanceCreationExpression)).isConst()) {
+ } else if (type is! InterfaceType) {
+ ASTNode parent = node.parent;
+ if (parent is InstanceCreationExpression) {
+ if (((parent as InstanceCreationExpression)).isConst()) {
} else {
}
} else {
@@ -1822,15 +1822,15 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return null;
}
ConstructorElement constructor;
- SimpleIdentifier name2 = node.name;
- InterfaceType interfaceType = type2 as InterfaceType;
- LibraryElement definingLibrary2 = _resolver.definingLibrary;
- if (name2 == null) {
- constructor = interfaceType.lookUpConstructor(null, definingLibrary2);
+ SimpleIdentifier name = node.name;
+ InterfaceType interfaceType = type as InterfaceType;
+ LibraryElement definingLibrary = _resolver.definingLibrary;
+ if (name == null) {
+ constructor = interfaceType.lookUpConstructor(null, definingLibrary);
} else {
- constructor = interfaceType.lookUpConstructor(name2.name, definingLibrary2);
- name2.staticElement = constructor;
- name2.element = constructor;
+ constructor = interfaceType.lookUpConstructor(name.name, definingLibrary);
+ name.staticElement = constructor;
+ name.element = constructor;
}
node.staticElement = constructor;
node.element = constructor;
@@ -1849,10 +1849,10 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return null;
}
Object visitExportDirective(ExportDirective node) {
- Element element2 = node.element;
- if (element2 is ExportElement) {
- resolveCombinators(((element2 as ExportElement)).exportedLibrary, node.combinators);
- setMetadata(element2, node);
+ Element element = node.element;
+ if (element is ExportElement) {
+ resolveCombinators(((element as ExportElement)).exportedLibrary, node.combinators);
+ setMetadata(element, node);
}
return null;
}
@@ -1911,14 +1911,14 @@ class ElementResolver extends SimpleASTVisitor<Object> {
}
}
}
- Element element2 = node.element;
- if (element2 is ImportElement) {
- ImportElement importElement = element2 as ImportElement;
+ Element element = node.element;
+ if (element is ImportElement) {
+ ImportElement importElement = element as ImportElement;
LibraryElement library = importElement.importedLibrary;
if (library != null) {
resolveCombinators(library, node.combinators);
}
- setMetadata(element2, node);
+ setMetadata(element, node);
}
return null;
}
@@ -1943,10 +1943,10 @@ class ElementResolver extends SimpleASTVisitor<Object> {
ConstructorElement invokedConstructor = node.constructorName.element;
node.staticElement = invokedConstructor;
node.element = invokedConstructor;
- ArgumentList argumentList2 = node.argumentList;
- List<ParameterElement> parameters = resolveArgumentsToParameters(node.isConst(), argumentList2, invokedConstructor);
+ ArgumentList argumentList = node.argumentList;
+ List<ParameterElement> parameters = resolveArgumentsToParameters(node.isConst(), argumentList, invokedConstructor);
if (parameters != null) {
- argumentList2.correspondingStaticParameters = parameters;
+ argumentList.correspondingStaticParameters = parameters;
}
return null;
}
@@ -1959,7 +1959,7 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return null;
}
Object visitMethodInvocation(MethodInvocation node) {
- SimpleIdentifier methodName2 = node.methodName;
+ SimpleIdentifier methodName = node.methodName;
Expression target = node.realTarget;
Element staticElement;
Element propagatedElement;
@@ -1967,27 +1967,27 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return null;
}
if (target == null) {
- staticElement = resolveInvokedElement2(methodName2);
+ staticElement = resolveInvokedElement2(methodName);
propagatedElement = null;
} else {
Type2 targetType = getStaticType(target);
- staticElement = resolveInvokedElement(target, targetType, methodName2);
- propagatedElement = resolveInvokedElement(target, getPropagatedType(target), methodName2);
+ staticElement = resolveInvokedElement(target, targetType, methodName);
+ propagatedElement = resolveInvokedElement(target, getPropagatedType(target), methodName);
}
staticElement = convertSetterToGetter(staticElement);
propagatedElement = convertSetterToGetter(propagatedElement);
- recordResolution2(methodName2, staticElement, propagatedElement);
- ArgumentList argumentList2 = node.argumentList;
+ recordResolution2(methodName, staticElement, propagatedElement);
+ ArgumentList argumentList = node.argumentList;
if (staticElement != null) {
- List<ParameterElement> parameters = computePropagatedParameters(argumentList2, staticElement);
+ List<ParameterElement> parameters = computePropagatedParameters(argumentList, staticElement);
if (parameters != null) {
- argumentList2.correspondingStaticParameters = parameters;
+ argumentList.correspondingStaticParameters = parameters;
}
}
if (propagatedElement != null) {
- List<ParameterElement> parameters = computePropagatedParameters(argumentList2, propagatedElement);
+ List<ParameterElement> parameters = computePropagatedParameters(argumentList, propagatedElement);
if (parameters != null) {
- argumentList2.correspondingParameters = parameters;
+ argumentList.correspondingParameters = parameters;
}
}
ErrorCode errorCode;
@@ -2005,14 +2005,14 @@ class ElementResolver extends SimpleASTVisitor<Object> {
}
}
if (identical(errorCode, StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION)) {
- _resolver.reportError(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName2, [methodName2.name]);
+ _resolver.reportError(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName, [methodName.name]);
} else if (identical(errorCode, StaticTypeWarningCode.UNDEFINED_FUNCTION)) {
- _resolver.reportError(StaticTypeWarningCode.UNDEFINED_FUNCTION, methodName2, [methodName2.name]);
+ _resolver.reportError(StaticTypeWarningCode.UNDEFINED_FUNCTION, methodName, [methodName.name]);
} else if (identical(errorCode, StaticTypeWarningCode.UNDEFINED_METHOD)) {
String targetTypeName;
if (target == null) {
- ClassElement enclosingClass2 = _resolver.enclosingClass;
- targetTypeName = enclosingClass2.displayName;
+ ClassElement enclosingClass = _resolver.enclosingClass;
+ targetTypeName = enclosingClass.displayName;
} else {
Type2 targetType = getPropagatedType(target);
if (targetType == null) {
@@ -2020,14 +2020,14 @@ class ElementResolver extends SimpleASTVisitor<Object> {
}
targetTypeName = targetType == null ? null : targetType.displayName;
}
- _resolver.reportError(StaticTypeWarningCode.UNDEFINED_METHOD, methodName2, [methodName2.name, targetTypeName]);
+ _resolver.reportError(StaticTypeWarningCode.UNDEFINED_METHOD, methodName, [methodName.name, targetTypeName]);
} else if (identical(errorCode, StaticTypeWarningCode.UNDEFINED_SUPER_METHOD)) {
Type2 targetType = getPropagatedType(target);
if (targetType == null) {
targetType = getStaticType(target);
}
String targetTypeName = targetType == null ? null : targetType.name;
- _resolver.reportError(StaticTypeWarningCode.UNDEFINED_SUPER_METHOD, methodName2, [methodName2.name, targetTypeName]);
+ _resolver.reportError(StaticTypeWarningCode.UNDEFINED_SUPER_METHOD, methodName, [methodName.name, targetTypeName]);
}
return null;
}
@@ -2040,13 +2040,13 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return null;
}
Object visitPostfixExpression(PostfixExpression node) {
- Expression operand2 = node.operand;
+ Expression operand = node.operand;
String methodName = getPostfixOperator(node);
- Type2 staticType = getStaticType(operand2);
- MethodElement staticMethod = lookUpMethod(operand2, staticType, methodName);
+ Type2 staticType = getStaticType(operand);
+ MethodElement staticMethod = lookUpMethod(operand, staticType, methodName);
node.staticElement = staticMethod;
- Type2 propagatedType = getPropagatedType(operand2);
- MethodElement propagatedMethod = lookUpMethod(operand2, propagatedType, methodName);
+ Type2 propagatedType = getPropagatedType(operand);
+ MethodElement propagatedMethod = lookUpMethod(operand, propagatedType, methodName);
node.element = select3(staticMethod, propagatedMethod);
if (shouldReportMissingMember(staticType, staticMethod) && (_strictMode || propagatedType == null || shouldReportMissingMember(propagatedType, propagatedMethod))) {
_resolver.reportError6(StaticTypeWarningCode.UNDEFINED_OPERATOR, node.operator, [methodName, staticType.displayName]);
@@ -2054,43 +2054,43 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return null;
}
Object visitPrefixedIdentifier(PrefixedIdentifier node) {
- SimpleIdentifier prefix2 = node.prefix;
- SimpleIdentifier identifier2 = node.identifier;
- Element prefixElement = prefix2.element;
+ SimpleIdentifier prefix = node.prefix;
+ SimpleIdentifier identifier = node.identifier;
+ Element prefixElement = prefix.element;
if (prefixElement is PrefixElement) {
Element element = _resolver.nameScope.lookup(node, _resolver.definingLibrary);
if (element == null) {
return null;
}
- if (element is PropertyAccessorElement && identifier2.inSetterContext()) {
- PropertyInducingElement variable2 = ((element as PropertyAccessorElement)).variable;
- if (variable2 != null) {
- PropertyAccessorElement setter2 = variable2.setter;
- if (setter2 != null) {
- element = setter2;
+ if (element is PropertyAccessorElement && identifier.inSetterContext()) {
+ PropertyInducingElement variable = ((element as PropertyAccessorElement)).variable;
+ if (variable != null) {
+ PropertyAccessorElement setter = variable.setter;
+ if (setter != null) {
+ element = setter;
}
}
}
- recordResolution(identifier2, element);
+ recordResolution(identifier, element);
return null;
}
- resolvePropertyAccess(prefix2, identifier2);
+ resolvePropertyAccess(prefix, identifier);
return null;
}
Object visitPrefixExpression(PrefixExpression node) {
- sc.Token operator2 = node.operator;
- sc.TokenType operatorType = operator2.type;
+ sc.Token operator = node.operator;
+ sc.TokenType operatorType = operator.type;
if (operatorType.isUserDefinableOperator() || identical(operatorType, sc.TokenType.PLUS_PLUS) || identical(operatorType, sc.TokenType.MINUS_MINUS)) {
- Expression operand2 = node.operand;
+ Expression operand = node.operand;
String methodName = getPrefixOperator(node);
- Type2 staticType = getStaticType(operand2);
- MethodElement staticMethod = lookUpMethod(operand2, staticType, methodName);
+ Type2 staticType = getStaticType(operand);
+ MethodElement staticMethod = lookUpMethod(operand, staticType, methodName);
node.staticElement = staticMethod;
- Type2 propagatedType = getPropagatedType(operand2);
- MethodElement propagatedMethod = lookUpMethod(operand2, propagatedType, methodName);
+ Type2 propagatedType = getPropagatedType(operand);
+ MethodElement propagatedMethod = lookUpMethod(operand, propagatedType, methodName);
node.element = select3(staticMethod, propagatedMethod);
if (shouldReportMissingMember(staticType, staticMethod) && (_strictMode || propagatedType == null || shouldReportMissingMember(propagatedType, propagatedMethod))) {
- _resolver.reportError6(StaticTypeWarningCode.UNDEFINED_OPERATOR, operator2, [methodName, staticType.displayName]);
+ _resolver.reportError6(StaticTypeWarningCode.UNDEFINED_OPERATOR, operator, [methodName, staticType.displayName]);
}
}
return null;
@@ -2100,21 +2100,21 @@ class ElementResolver extends SimpleASTVisitor<Object> {
if (target is SuperExpression && !isSuperInValidContext((target as SuperExpression))) {
return null;
}
- SimpleIdentifier propertyName2 = node.propertyName;
- resolvePropertyAccess(target, propertyName2);
+ SimpleIdentifier propertyName = node.propertyName;
+ resolvePropertyAccess(target, propertyName);
return null;
}
Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
- ClassElement enclosingClass2 = _resolver.enclosingClass;
- if (enclosingClass2 == null) {
+ ClassElement enclosingClass = _resolver.enclosingClass;
+ if (enclosingClass == null) {
return null;
}
SimpleIdentifier name = node.constructorName;
ConstructorElement element;
if (name == null) {
- element = enclosingClass2.unnamedConstructor;
+ element = enclosingClass.unnamedConstructor;
} else {
- element = enclosingClass2.getNamedConstructor(name.name);
+ element = enclosingClass.getNamedConstructor(name.name);
}
if (element == null) {
return null;
@@ -2124,10 +2124,10 @@ class ElementResolver extends SimpleASTVisitor<Object> {
}
node.staticElement = element;
node.element = element;
- ArgumentList argumentList2 = node.argumentList;
- List<ParameterElement> parameters = resolveArgumentsToParameters(false, argumentList2, element);
+ ArgumentList argumentList = node.argumentList;
+ List<ParameterElement> parameters = resolveArgumentsToParameters(false, argumentList, element);
if (parameters != null) {
- argumentList2.correspondingStaticParameters = parameters;
+ argumentList.correspondingStaticParameters = parameters;
}
return null;
}
@@ -2149,11 +2149,11 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return null;
}
Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
- ClassElement enclosingClass2 = _resolver.enclosingClass;
- if (enclosingClass2 == null) {
+ ClassElement enclosingClass = _resolver.enclosingClass;
+ if (enclosingClass == null) {
return null;
}
- ClassElement superclass = getSuperclass(enclosingClass2);
+ ClassElement superclass = getSuperclass(enclosingClass);
if (superclass == null) {
return null;
}
@@ -2181,10 +2181,10 @@ class ElementResolver extends SimpleASTVisitor<Object> {
}
node.staticElement = element;
node.element = element;
- ArgumentList argumentList2 = node.argumentList;
- List<ParameterElement> parameters = resolveArgumentsToParameters(false, argumentList2, element);
+ ArgumentList argumentList = node.argumentList;
+ List<ParameterElement> parameters = resolveArgumentsToParameters(false, argumentList, element);
if (parameters != null) {
- argumentList2.correspondingStaticParameters = parameters;
+ argumentList.correspondingStaticParameters = parameters;
}
return null;
}
@@ -2195,11 +2195,11 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return super.visitSuperExpression(node);
}
Object visitTypeParameter(TypeParameter node) {
- TypeName bound2 = node.bound;
- if (bound2 != null) {
+ TypeName bound = node.bound;
+ if (bound != null) {
TypeVariableElementImpl variable = node.name.element as TypeVariableElementImpl;
if (variable != null) {
- variable.bound = bound2.type;
+ variable.bound = bound.type;
}
}
setMetadata(node.element, node);
@@ -2236,8 +2236,8 @@ class ElementResolver extends SimpleASTVisitor<Object> {
if (element2 is PropertyAccessorElement) {
FunctionType getterType = ((element2 as PropertyAccessorElement)).type;
if (getterType != null) {
- Type2 returnType2 = getterType.returnType;
- if (!isExecutableType(returnType2)) {
+ Type2 returnType = getterType.returnType;
+ if (!isExecutableType(returnType)) {
return StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION;
}
}
@@ -2247,11 +2247,11 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return StaticTypeWarningCode.UNDEFINED_SUPER_METHOD;
} else {
if (element2 is PropertyInducingElement) {
- PropertyAccessorElement getter2 = ((element2 as PropertyInducingElement)).getter;
- FunctionType getterType = getter2.type;
+ PropertyAccessorElement getter = ((element2 as PropertyInducingElement)).getter;
+ FunctionType getterType = getter.type;
if (getterType != null) {
- Type2 returnType3 = getterType.returnType;
- if (!isExecutableType(returnType3)) {
+ Type2 returnType = getterType.returnType;
+ if (!isExecutableType(returnType)) {
return StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION;
}
}
@@ -2265,11 +2265,11 @@ class ElementResolver extends SimpleASTVisitor<Object> {
}
} else {
if (target == null) {
- ClassElement enclosingClass2 = _resolver.enclosingClass;
- if (enclosingClass2 == null) {
+ ClassElement enclosingClass = _resolver.enclosingClass;
+ if (enclosingClass == null) {
return StaticTypeWarningCode.UNDEFINED_FUNCTION;
} else if (element2 == null) {
- if (!classDeclaresNoSuchMethod(enclosingClass2)) {
+ if (!classDeclaresNoSuchMethod(enclosingClass)) {
return StaticTypeWarningCode.UNDEFINED_METHOD;
}
} else {
@@ -2345,16 +2345,16 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return resolveArgumentsToParameters(false, argumentList, (element2 as ExecutableElement));
} else if (element2 is VariableElement) {
VariableElement variable = element2 as VariableElement;
- Type2 type2 = variable.type;
- if (type2 is FunctionType) {
- FunctionType functionType = type2 as FunctionType;
- List<ParameterElement> parameters2 = functionType.parameters;
- return resolveArgumentsToParameters2(false, argumentList, parameters2);
- } else if (type2 is InterfaceType) {
- MethodElement callMethod = ((type2 as InterfaceType)).lookUpMethod(CALL_METHOD_NAME, _resolver.definingLibrary);
+ Type2 type = variable.type;
+ if (type is FunctionType) {
+ FunctionType functionType = type as FunctionType;
+ List<ParameterElement> parameters = functionType.parameters;
+ return resolveArgumentsToParameters2(false, argumentList, parameters);
+ } else if (type is InterfaceType) {
+ MethodElement callMethod = ((type as InterfaceType)).lookUpMethod(CALL_METHOD_NAME, _resolver.definingLibrary);
if (callMethod != null) {
- List<ParameterElement> parameters3 = callMethod.parameters;
- return resolveArgumentsToParameters2(false, argumentList, parameters3);
+ List<ParameterElement> parameters = callMethod.parameters;
+ return resolveArgumentsToParameters2(false, argumentList, parameters);
}
}
}
@@ -2382,18 +2382,18 @@ class ElementResolver extends SimpleASTVisitor<Object> {
*/
Element findImportWithoutPrefix(SimpleIdentifier identifier) {
Element element = null;
- Scope nameScope2 = _resolver.nameScope;
- LibraryElement definingLibrary2 = _resolver.definingLibrary;
- for (ImportElement importElement in definingLibrary2.imports) {
+ Scope nameScope = _resolver.nameScope;
+ LibraryElement definingLibrary = _resolver.definingLibrary;
+ for (ImportElement importElement in definingLibrary.imports) {
PrefixElement prefixElement = importElement.prefix;
if (prefixElement != null) {
Identifier prefixedIdentifier = new ElementResolver_SyntheticIdentifier("${prefixElement.name}.${identifier.name}");
- Element importedElement = nameScope2.lookup(prefixedIdentifier, definingLibrary2);
+ Element importedElement = nameScope.lookup(prefixedIdentifier, definingLibrary);
if (importedElement != null) {
if (element == null) {
element = importedElement;
} else {
- element = new MultiplyDefinedElementImpl(definingLibrary2.context, element, importedElement);
+ element = new MultiplyDefinedElementImpl(definingLibrary.context, element, importedElement);
}
}
}
@@ -2414,8 +2414,8 @@ class ElementResolver extends SimpleASTVisitor<Object> {
* @return the name of the method invoked by the expression
*/
String getPrefixOperator(PrefixExpression node) {
- sc.Token operator2 = node.operator;
- sc.TokenType operatorType = operator2.type;
+ sc.Token operator = node.operator;
+ sc.TokenType operatorType = operator.type;
if (identical(operatorType, sc.TokenType.PLUS_PLUS)) {
return sc.TokenType.PLUS.lexeme;
} else if (identical(operatorType, sc.TokenType.MINUS_MINUS)) {
@@ -2423,7 +2423,7 @@ class ElementResolver extends SimpleASTVisitor<Object> {
} else if (identical(operatorType, sc.TokenType.MINUS)) {
return "unary-";
} else {
- return operator2.lexeme;
+ return operator.lexeme;
}
}
@@ -2433,11 +2433,11 @@ class ElementResolver extends SimpleASTVisitor<Object> {
* @return the type of the given expression
*/
Type2 getPropagatedType(Expression expression) {
- Type2 propagatedType2 = resolveTypeVariable(expression.propagatedType);
- if (propagatedType2 is FunctionType) {
- propagatedType2 = _resolver.typeProvider.functionType;
+ Type2 propagatedType = resolveTypeVariable(expression.propagatedType);
+ if (propagatedType is FunctionType) {
+ propagatedType = _resolver.typeProvider.functionType;
}
- return propagatedType2;
+ return propagatedType;
}
/**
@@ -2449,11 +2449,11 @@ class ElementResolver extends SimpleASTVisitor<Object> {
if (expression is NullLiteral) {
return _resolver.typeProvider.objectType;
}
- Type2 staticType2 = resolveTypeVariable(expression.staticType);
- if (staticType2 is FunctionType) {
- staticType2 = _resolver.typeProvider.functionType;
+ Type2 staticType = resolveTypeVariable(expression.staticType);
+ if (staticType is FunctionType) {
+ staticType = _resolver.typeProvider.functionType;
}
- return staticType2;
+ return staticType;
}
/**
@@ -2514,15 +2514,15 @@ class ElementResolver extends SimpleASTVisitor<Object> {
node.staticElement = staticMethod;
node.element = select3(staticMethod, propagatedMethod);
if (shouldReportMissingMember(staticType, staticMethod) && (_strictMode || propagatedType == null || shouldReportMissingMember(propagatedType, propagatedMethod))) {
- sc.Token leftBracket2 = node.leftBracket;
- sc.Token rightBracket2 = node.rightBracket;
- if (leftBracket2 == null || rightBracket2 == null) {
+ sc.Token leftBracket = node.leftBracket;
+ sc.Token rightBracket = node.rightBracket;
+ if (leftBracket == null || rightBracket == null) {
_resolver.reportError(StaticTypeWarningCode.UNDEFINED_OPERATOR, node, [methodName, staticType.displayName]);
return true;
} else {
- int offset2 = leftBracket2.offset;
- int length = rightBracket2.offset - offset2 + 1;
- _resolver.reportError5(StaticTypeWarningCode.UNDEFINED_OPERATOR, offset2, length, [methodName, staticType.displayName]);
+ int offset = leftBracket.offset;
+ int length = rightBracket.offset - offset + 1;
+ _resolver.reportError5(StaticTypeWarningCode.UNDEFINED_OPERATOR, offset, length, [methodName, staticType.displayName]);
return true;
}
}
@@ -2589,11 +2589,11 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return getter;
}
}
- InterfaceType superclass2 = targetType.superclass;
- if (superclass2 == null) {
+ InterfaceType superclass = targetType.superclass;
+ if (superclass == null) {
return null;
}
- return lookUpGetterInInterfaces(superclass2, true, getterName, visitedInterfaces);
+ return lookUpGetterInInterfaces(superclass, true, getterName, visitedInterfaces);
}
/**
@@ -2660,11 +2660,11 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return member;
}
}
- InterfaceType superclass2 = targetType.superclass;
- if (superclass2 == null) {
+ InterfaceType superclass = targetType.superclass;
+ if (superclass == null) {
return null;
}
- return lookUpGetterOrMethodInInterfaces(superclass2, true, memberName, visitedInterfaces);
+ return lookUpGetterOrMethodInInterfaces(superclass, true, memberName, visitedInterfaces);
}
/**
@@ -2674,21 +2674,21 @@ class ElementResolver extends SimpleASTVisitor<Object> {
* @return the element corresponding to the given label node in the current scope
*/
LabelElementImpl lookupLabel(ASTNode parentNode, SimpleIdentifier labelNode) {
- LabelScope labelScope2 = _resolver.labelScope;
+ LabelScope labelScope = _resolver.labelScope;
LabelElementImpl labelElement = null;
if (labelNode == null) {
- if (labelScope2 == null) {
+ if (labelScope == null) {
} else {
- labelElement = labelScope2.lookup2(LabelScope.EMPTY_LABEL) as LabelElementImpl;
+ labelElement = labelScope.lookup2(LabelScope.EMPTY_LABEL) as LabelElementImpl;
if (labelElement == null) {
}
labelElement = null;
}
} else {
- if (labelScope2 == null) {
+ if (labelScope == null) {
_resolver.reportError(CompileTimeErrorCode.LABEL_UNDEFINED, labelNode, [labelNode.name]);
} else {
- labelElement = labelScope2.lookup(labelNode) as LabelElementImpl;
+ labelElement = labelScope.lookup(labelNode) as LabelElementImpl;
if (labelElement == null) {
_resolver.reportError(CompileTimeErrorCode.LABEL_UNDEFINED, labelNode, [labelNode.name]);
} else {
@@ -2766,11 +2766,11 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return method;
}
}
- InterfaceType superclass2 = targetType.superclass;
- if (superclass2 == null) {
+ InterfaceType superclass = targetType.superclass;
+ if (superclass == null) {
return null;
}
- return lookUpMethodInInterfaces(superclass2, true, methodName, visitedInterfaces);
+ return lookUpMethodInInterfaces(superclass, true, methodName, visitedInterfaces);
}
/**
@@ -2833,11 +2833,11 @@ class ElementResolver extends SimpleASTVisitor<Object> {
return setter;
}
}
- InterfaceType superclass2 = targetType.superclass;
- if (superclass2 == null) {
+ InterfaceType superclass = targetType.superclass;
+ if (superclass == null) {
return null;
}
- return lookUpSetterInInterfaces(superclass2, true, setterName, visitedInterfaces);
+ return lookUpSetterInInterfaces(superclass, true, setterName, visitedInterfaces);
}
/**
@@ -2913,8 +2913,8 @@ class ElementResolver extends SimpleASTVisitor<Object> {
if (executableElement == null) {
return null;
}
- List<ParameterElement> parameters2 = executableElement.parameters;
- return resolveArgumentsToParameters2(reportError, argumentList, parameters2);
+ List<ParameterElement> parameters = executableElement.parameters;
+ return resolveArgumentsToParameters2(reportError, argumentList, parameters);
}
/**
@@ -2944,26 +2944,26 @@ class ElementResolver extends SimpleASTVisitor<Object> {
unnamedParameters.addAll(positionalParameters);
int unnamedParameterCount = unnamedParameters.length;
int unnamedIndex = 0;
- NodeList<Expression> arguments2 = argumentList.arguments;
- int argumentCount = arguments2.length;
+ NodeList<Expression> arguments = argumentList.arguments;
+ int argumentCount = arguments.length;
List<ParameterElement> resolvedParameters = new List<ParameterElement>(argumentCount);
int positionalArgumentCount = 0;
Set<String> usedNames = new Set<String>();
for (int i = 0; i < argumentCount; i++) {
- Expression argument = arguments2[i];
+ Expression argument = arguments[i];
if (argument is NamedExpression) {
SimpleIdentifier nameNode = ((argument as NamedExpression)).name.label;
- String name2 = nameNode.name;
- ParameterElement element = namedParameters[name2];
+ String name = nameNode.name;
+ ParameterElement element = namedParameters[name];
if (element == null) {
ErrorCode errorCode = reportError2 ? CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER : StaticWarningCode.UNDEFINED_NAMED_PARAMETER;
- _resolver.reportError(errorCode, nameNode, [name2]);
+ _resolver.reportError(errorCode, nameNode, [name]);
} else {
resolvedParameters[i] = element;
recordResolution(nameNode, element);
}
- if (!javaSetAdd(usedNames, name2)) {
- _resolver.reportError(CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT, nameNode, [name2]);
+ if (!javaSetAdd(usedNames, name)) {
+ _resolver.reportError(CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT, nameNode, [name]);
}
} else {
positionalArgumentCount++;
@@ -3029,8 +3029,8 @@ class ElementResolver extends SimpleASTVisitor<Object> {
} else if (target is SimpleIdentifier) {
Element targetElement = ((target as SimpleIdentifier)).element;
if (targetElement is PrefixElement) {
- String name2 = "${((target as SimpleIdentifier)).name}.${methodName}";
- Identifier functionName = new ElementResolver_SyntheticIdentifier(name2);
+ String name = "${((target as SimpleIdentifier)).name}.${methodName}";
+ Identifier functionName = new ElementResolver_SyntheticIdentifier(name);
Element element = _resolver.nameScope.lookup(functionName, _resolver.definingLibrary);
if (element != null) {
return element;
@@ -3051,9 +3051,9 @@ class ElementResolver extends SimpleASTVisitor<Object> {
Element resolveInvokedElement2(SimpleIdentifier methodName) {
Element element = _resolver.nameScope.lookup(methodName, _resolver.definingLibrary);
if (element == null) {
- ClassElement enclosingClass2 = _resolver.enclosingClass;
- if (enclosingClass2 != null) {
- InterfaceType enclosingType = enclosingClass2.type;
+ ClassElement enclosingClass = _resolver.enclosingClass;
+ if (enclosingClass != null) {
+ InterfaceType enclosingType = enclosingClass.type;
element = lookUpMethod(null, enclosingType, methodName.name);
if (element == null) {
element = lookUpGetter(null, enclosingType, methodName.name);
@@ -3126,25 +3126,25 @@ class ElementResolver extends SimpleASTVisitor<Object> {
Element resolveSimpleIdentifier(SimpleIdentifier node) {
Element element = _resolver.nameScope.lookup(node, _resolver.definingLibrary);
if (element is PropertyAccessorElement && node.inSetterContext()) {
- PropertyInducingElement variable2 = ((element as PropertyAccessorElement)).variable;
- if (variable2 != null) {
- PropertyAccessorElement setter2 = variable2.setter;
- if (setter2 == null) {
- ClassElement enclosingClass2 = _resolver.enclosingClass;
- if (enclosingClass2 != null) {
- setter2 = lookUpSetter(null, enclosingClass2.type, node.name);
+ PropertyInducingElement variable = ((element as PropertyAccessorElement)).variable;
+ if (variable != null) {
+ PropertyAccessorElement setter = variable.setter;
+ if (setter == null) {
+ ClassElement enclosingClass = _resolver.enclosingClass;
+ if (enclosingClass != null) {
+ setter = lookUpSetter(null, enclosingClass.type, node.name);
}
}
- if (setter2 != null) {
- element = setter2;
+ if (setter != null) {
+ element = setter;
}
}
} else if (element == null && node.inSetterContext()) {
element = _resolver.nameScope.lookup(new ElementResolver_SyntheticIdentifier("${node.name}="), _resolver.definingLibrary);
}
- ClassElement enclosingClass3 = _resolver.enclosingClass;
- if (element == null && enclosingClass3 != null) {
- InterfaceType enclosingType = enclosingClass3.type;
+ ClassElement enclosingClass = _resolver.enclosingClass;
+ if (element == null && enclosingClass != null) {
+ InterfaceType enclosingType = enclosingClass.type;
if (element == null && node.inSetterContext()) {
element = lookUpSetter(null, enclosingType, node.name);
}
@@ -3167,11 +3167,11 @@ class ElementResolver extends SimpleASTVisitor<Object> {
*/
Type2 resolveTypeVariable(Type2 type) {
if (type is TypeVariableType) {
- Type2 bound2 = ((type as TypeVariableType)).element.bound;
- if (bound2 == null) {
+ Type2 bound = ((type as TypeVariableType)).element.bound;
+ if (bound == null) {
return _resolver.typeProvider.objectType;
}
- return bound2;
+ return bound;
}
return type;
}
@@ -3434,9 +3434,9 @@ class InheritanceManager {
resultMap = new Map<String, ExecutableElement>();
}
ClassElement superclassElt = null;
- InterfaceType supertype2 = classElt.supertype;
- if (supertype2 != null) {
- superclassElt = supertype2.element;
+ InterfaceType supertype = classElt.supertype;
+ if (supertype != null) {
+ superclassElt = supertype.element;
} else {
_classLookup[classElt] = resultMap;
return resultMap;
@@ -3451,9 +3451,9 @@ class InheritanceManager {
}
recordMapWithClassMembers(resultMap, superclassElt);
}
- List<InterfaceType> mixins2 = classElt.mixins;
- for (int i = mixins2.length - 1; i >= 0; i--) {
- ClassElement mixinElement = mixins2[i].element;
+ List<InterfaceType> mixins = classElt.mixins;
+ for (int i = mixins.length - 1; i >= 0; i--) {
+ ClassElement mixinElement = mixins[i].element;
if (mixinElement != null) {
recordMapWithClassMembers(resultMap, mixinElement);
}
@@ -3473,8 +3473,8 @@ class InheritanceManager {
void computeInheritancePath(Queue<InterfaceType> chain, InterfaceType currentType, String memberName) {
chain.add(currentType);
ClassElement classElt = currentType.element;
- InterfaceType supertype2 = classElt.supertype;
- if (supertype2 == null) {
+ InterfaceType supertype = classElt.supertype;
+ if (supertype == null) {
return;
}
if (chain.length != 1) {
@@ -3482,24 +3482,24 @@ class InheritanceManager {
return;
}
}
- List<InterfaceType> mixins2 = classElt.mixins;
- for (int i = mixins2.length - 1; i >= 0; i--) {
- ClassElement mixinElement = mixins2[i].element;
+ List<InterfaceType> mixins = classElt.mixins;
+ for (int i = mixins.length - 1; i >= 0; i--) {
+ ClassElement mixinElement = mixins[i].element;
if (mixinElement != null) {
ExecutableElement elt = lookupMemberInClass(mixinElement, memberName);
if (elt != null) {
- chain.add(mixins2[i]);
+ chain.add(mixins[i]);
return;
}
}
}
- ClassElement superclassElt = supertype2.element;
+ ClassElement superclassElt = supertype.element;
if (lookupMember(superclassElt, memberName) != null) {
- computeInheritancePath(chain, supertype2, memberName);
+ computeInheritancePath(chain, supertype, memberName);
return;
}
- List<InterfaceType> interfaces2 = classElt.interfaces;
- for (InterfaceType interfaceType in interfaces2) {
+ List<InterfaceType> interfaces = classElt.interfaces;
+ for (InterfaceType interfaceType in interfaces) {
ClassElement interfaceElement = interfaceType.element;
if (interfaceElement != null && lookupMember(interfaceElement, memberName) != null) {
computeInheritancePath(chain, interfaceType, memberName);
@@ -3523,10 +3523,10 @@ class InheritanceManager {
} else {
resultMap = new Map<String, ExecutableElement>();
}
- InterfaceType supertype2 = classElt.supertype;
- ClassElement superclassElement = supertype2 != null ? supertype2.element : null;
- List<InterfaceType> interfaces2 = classElt.interfaces;
- if (superclassElement == null || interfaces2.length == 0) {
+ InterfaceType supertype = classElt.supertype;
+ ClassElement superclassElement = supertype != null ? supertype.element : null;
+ List<InterfaceType> interfaces = classElt.interfaces;
+ if (superclassElement == null || interfaces.length == 0) {
_interfaceLookup[classElt] = resultMap;
return resultMap;
}
@@ -3549,7 +3549,7 @@ class InheritanceManager {
}
}
}
- for (InterfaceType interfaceType in interfaces2) {
+ for (InterfaceType interfaceType in interfaces) {
ClassElement interfaceElement = interfaceType.element;
if (interfaceElement != null) {
if (!visitedInterfaces.contains(interfaceElement)) {
@@ -3588,8 +3588,8 @@ class InheritanceManager {
}
}
if (superclassElement != null) {
- List<MethodElement> methods2 = superclassElement.methods;
- for (MethodElement method in methods2) {
+ List<MethodElement> methods = superclassElement.methods;
+ for (MethodElement method in methods) {
if (method.isAccessibleIn(_library) && !method.isStatic()) {
String key = method.name;
if (!unionMap.containsKey(key)) {
@@ -3601,8 +3601,8 @@ class InheritanceManager {
}
}
}
- List<PropertyAccessorElement> accessors2 = superclassElement.accessors;
- for (PropertyAccessorElement accessor in accessors2) {
+ List<PropertyAccessorElement> accessors = superclassElement.accessors;
+ for (PropertyAccessorElement accessor in accessors) {
if (accessor.isAccessibleIn(_library) && !accessor.isStatic()) {
String key = accessor.name;
if (!unionMap.containsKey(key)) {
@@ -3615,11 +3615,11 @@ class InheritanceManager {
}
}
}
- for (InterfaceType interfaceType in interfaces2) {
+ for (InterfaceType interfaceType in interfaces) {
ClassElement interfaceElement = interfaceType.element;
if (interfaceElement != null) {
- List<MethodElement> methods3 = interfaceElement.methods;
- for (MethodElement method in methods3) {
+ List<MethodElement> methods = interfaceElement.methods;
+ for (MethodElement method in methods) {
if (method.isAccessibleIn(_library) && !method.isStatic()) {
String key = method.name;
if (!unionMap.containsKey(key)) {
@@ -3631,8 +3631,8 @@ class InheritanceManager {
}
}
}
- List<PropertyAccessorElement> accessors3 = interfaceElement.accessors;
- for (PropertyAccessorElement accessor in accessors3) {
+ List<PropertyAccessorElement> accessors = interfaceElement.accessors;
+ for (PropertyAccessorElement accessor in accessors) {
if (accessor.isAccessibleIn(_library) && !accessor.isStatic()) {
String key = accessor.name;
if (!unionMap.containsKey(key)) {
@@ -3720,14 +3720,14 @@ class InheritanceManager {
* @return the found {@link ExecutableElement}, or {@code null} if no such member was found
*/
ExecutableElement lookupMemberInClass(ClassElement classElt, String memberName) {
- List<MethodElement> methods2 = classElt.methods;
- for (MethodElement method in methods2) {
+ List<MethodElement> methods = classElt.methods;
+ for (MethodElement method in methods) {
if (memberName == method.name && method.isAccessibleIn(_library) && !method.isStatic()) {
return method;
}
}
- List<PropertyAccessorElement> accessors2 = classElt.accessors;
- for (PropertyAccessorElement accessor in accessors2) {
+ List<PropertyAccessorElement> accessors = classElt.accessors;
+ for (PropertyAccessorElement accessor in accessors) {
if (memberName == accessor.name && accessor.isAccessibleIn(_library) && !accessor.isStatic()) {
return accessor;
}
@@ -3742,14 +3742,14 @@ class InheritanceManager {
* @param classElt the class element that will be recorded into the passed map
*/
void recordMapWithClassMembers(Map<String, ExecutableElement> map, ClassElement classElt) {
- List<MethodElement> methods2 = classElt.methods;
- for (MethodElement method in methods2) {
+ List<MethodElement> methods = classElt.methods;
+ for (MethodElement method in methods) {
if (method.isAccessibleIn(_library) && !method.isStatic()) {
map[method.name] = method;
}
}
- List<PropertyAccessorElement> accessors2 = classElt.accessors;
- for (PropertyAccessorElement accessor in accessors2) {
+ List<PropertyAccessorElement> accessors = classElt.accessors;
+ for (PropertyAccessorElement accessor in accessors) {
if (accessor.isAccessibleIn(_library) && !accessor.isStatic()) {
map[accessor.name] = accessor;
}
@@ -4105,16 +4105,16 @@ class LibraryElementBuilder {
*/
LibraryElementImpl buildLibrary(Library library) {
CompilationUnitBuilder builder = new CompilationUnitBuilder();
- Source librarySource2 = library.librarySource;
- CompilationUnit definingCompilationUnit2 = library.definingCompilationUnit;
- CompilationUnitElementImpl definingCompilationUnitElement = builder.buildCompilationUnit(librarySource2, definingCompilationUnit2);
- NodeList<Directive> directives2 = definingCompilationUnit2.directives;
+ Source librarySource = library.librarySource;
+ CompilationUnit definingCompilationUnit = library.definingCompilationUnit;
+ CompilationUnitElementImpl definingCompilationUnitElement = builder.buildCompilationUnit(librarySource, definingCompilationUnit);
+ NodeList<Directive> directives = definingCompilationUnit.directives;
LibraryIdentifier libraryNameNode = null;
bool hasPartDirective = false;
FunctionElement entryPoint = findEntryPoint(definingCompilationUnitElement);
List<Directive> directivesToResolve = new List<Directive>();
List<CompilationUnitElementImpl> sourcedCompilationUnits = new List<CompilationUnitElementImpl>();
- for (Directive directive in directives2) {
+ for (Directive directive in directives) {
if (directive is LibraryDirective) {
if (libraryNameNode == null) {
libraryNameNode = ((directive as LibraryDirective)).name;
@@ -4130,10 +4130,10 @@ class LibraryElementBuilder {
part.uri = library.getUri(partDirective);
String partLibraryName = getPartLibraryName(library, partSource, directivesToResolve);
if (partLibraryName == null) {
- _errorListener.onError(new AnalysisError.con2(librarySource2, partUri.offset, partUri.length, CompileTimeErrorCode.PART_OF_NON_PART, [partUri.toSource()]));
+ _errorListener.onError(new AnalysisError.con2(librarySource, partUri.offset, partUri.length, CompileTimeErrorCode.PART_OF_NON_PART, [partUri.toSource()]));
} else if (libraryNameNode == null) {
} else if (libraryNameNode.name != partLibraryName) {
- _errorListener.onError(new AnalysisError.con2(librarySource2, partUri.offset, partUri.length, StaticWarningCode.PART_OF_DIFFERENT_LIBRARY, [libraryNameNode.name, partLibraryName]));
+ _errorListener.onError(new AnalysisError.con2(librarySource, partUri.offset, partUri.length, StaticWarningCode.PART_OF_DIFFERENT_LIBRARY, [libraryNameNode.name, partLibraryName]));
}
if (entryPoint == null) {
entryPoint = findEntryPoint(part);
@@ -4144,7 +4144,7 @@ class LibraryElementBuilder {
}
}
if (hasPartDirective && libraryNameNode == null) {
- _errorListener.onError(new AnalysisError.con1(librarySource2, ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART, []));
+ _errorListener.onError(new AnalysisError.con1(librarySource, ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART, []));
}
LibraryElementImpl libraryElement = new LibraryElementImpl(_analysisContext, libraryNameNode);
libraryElement.definingCompilationUnit = definingCompilationUnitElement;
@@ -4213,9 +4213,9 @@ class LibraryElementBuilder {
for (Directive directive in partUnit.directives) {
if (directive is PartOfDirective) {
directivesToResolve.add(directive);
- LibraryIdentifier libraryName2 = ((directive as PartOfDirective)).libraryName;
- if (libraryName2 != null) {
- return libraryName2.name;
+ LibraryIdentifier libraryName = ((directive as PartOfDirective)).libraryName;
+ if (libraryName != null) {
+ return libraryName.name;
}
}
}
@@ -4240,9 +4240,9 @@ class LibraryElementBuilder {
for (PropertyAccessorElement setter in setters) {
PropertyAccessorElement getter = getters[setter.displayName];
if (getter != null) {
- PropertyInducingElementImpl variable2 = getter.variable as PropertyInducingElementImpl;
- variable2.setter = setter;
- ((setter as PropertyAccessorElementImpl)).variable = variable2;
+ PropertyInducingElementImpl variable = getter.variable as PropertyInducingElementImpl;
+ variable.setter = setter;
+ ((setter as PropertyAccessorElementImpl)).variable = variable;
}
}
}
@@ -4548,16 +4548,16 @@ class LibraryResolver {
}
}
}
- Source librarySource2 = library.librarySource;
- if (!library.explicitlyImportsCore && _coreLibrarySource != librarySource2) {
+ Source librarySource = library.librarySource;
+ if (!library.explicitlyImportsCore && _coreLibrarySource != librarySource) {
ImportElementImpl importElement = new ImportElementImpl();
importElement.importedLibrary = _coreLibrary.libraryElement;
importElement.synthetic = true;
imports.add(importElement);
}
- LibraryElementImpl libraryElement2 = library.libraryElement;
- libraryElement2.imports = new List.from(imports);
- libraryElement2.exports = new List.from(exports);
+ LibraryElementImpl libraryElement = library.libraryElement;
+ libraryElement.imports = new List.from(imports);
+ libraryElement.exports = new List.from(exports);
}
}
@@ -4737,8 +4737,8 @@ class LibraryResolver {
* @return {@code true} if and only if the passed {@link CompilationUnit} has a part-of directive
*/
bool doesCompilationUnitHavePartOfDirective(CompilationUnit node) {
- NodeList<Directive> directives2 = node.directives;
- for (Directive directive in directives2) {
+ NodeList<Directive> directives = node.directives;
+ for (Directive directive in directives) {
if (directive is PartOfDirective) {
return true;
}
@@ -4918,33 +4918,33 @@ class ResolverVisitor extends ScopedVisitor {
}
Object visitBinaryExpression(BinaryExpression node) {
sc.TokenType operatorType = node.operator.type;
- Expression leftOperand2 = node.leftOperand;
- Expression rightOperand2 = node.rightOperand;
+ Expression leftOperand = node.leftOperand;
+ Expression rightOperand = node.rightOperand;
if (identical(operatorType, sc.TokenType.AMPERSAND_AMPERSAND)) {
- safelyVisit(leftOperand2);
- if (rightOperand2 != null) {
+ safelyVisit(leftOperand);
+ if (rightOperand != null) {
try {
_overrideManager.enterScope();
- propagateTrueState(leftOperand2);
- rightOperand2.accept(this);
+ propagateTrueState(leftOperand);
+ rightOperand.accept(this);
} finally {
_overrideManager.exitScope();
}
}
} else if (identical(operatorType, sc.TokenType.BAR_BAR)) {
- safelyVisit(leftOperand2);
- if (rightOperand2 != null) {
+ safelyVisit(leftOperand);
+ if (rightOperand != null) {
try {
_overrideManager.enterScope();
- propagateFalseState(leftOperand2);
- rightOperand2.accept(this);
+ propagateFalseState(leftOperand);
+ rightOperand.accept(this);
} finally {
_overrideManager.exitScope();
}
}
} else {
- safelyVisit(leftOperand2);
- safelyVisit(rightOperand2);
+ safelyVisit(leftOperand);
+ safelyVisit(rightOperand);
}
node.accept(_elementResolver);
node.accept(_typeAnalyzer);
@@ -4997,38 +4997,38 @@ class ResolverVisitor extends ScopedVisitor {
return null;
}
Object visitConditionalExpression(ConditionalExpression node) {
- Expression condition2 = node.condition;
- safelyVisit(condition2);
- Expression thenExpression2 = node.thenExpression;
- if (thenExpression2 != null) {
+ Expression condition = node.condition;
+ safelyVisit(condition);
+ Expression thenExpression = node.thenExpression;
+ if (thenExpression != null) {
try {
_overrideManager.enterScope();
- propagateTrueState(condition2);
- thenExpression2.accept(this);
+ propagateTrueState(condition);
+ thenExpression.accept(this);
} finally {
_overrideManager.exitScope();
}
}
- Expression elseExpression2 = node.elseExpression;
- if (elseExpression2 != null) {
+ Expression elseExpression = node.elseExpression;
+ if (elseExpression != null) {
try {
_overrideManager.enterScope();
- propagateFalseState(condition2);
- elseExpression2.accept(this);
+ propagateFalseState(condition);
+ elseExpression.accept(this);
} finally {
_overrideManager.exitScope();
}
}
node.accept(_elementResolver);
node.accept(_typeAnalyzer);
- bool thenIsAbrupt = isAbruptTermination(thenExpression2);
- bool elseIsAbrupt = isAbruptTermination(elseExpression2);
+ bool thenIsAbrupt = isAbruptTermination(thenExpression);
+ bool elseIsAbrupt = isAbruptTermination(elseExpression);
if (elseIsAbrupt && !thenIsAbrupt) {
- propagateTrueState(condition2);
- propagateState(thenExpression2);
+ propagateTrueState(condition);
+ propagateState(thenExpression);
} else if (thenIsAbrupt && !elseIsAbrupt) {
- propagateFalseState(condition2);
- propagateState(elseExpression2);
+ propagateFalseState(condition);
+ propagateState(elseExpression);
}
return null;
}
@@ -5130,27 +5130,27 @@ class ResolverVisitor extends ScopedVisitor {
}
Object visitHideCombinator(HideCombinator node) => null;
Object visitIfStatement(IfStatement node) {
- Expression condition2 = node.condition;
- safelyVisit(condition2);
+ Expression condition = node.condition;
+ safelyVisit(condition);
Map<Element, Type2> thenOverrides = null;
- Statement thenStatement2 = node.thenStatement;
- if (thenStatement2 != null) {
+ Statement thenStatement = node.thenStatement;
+ if (thenStatement != null) {
try {
_overrideManager.enterScope();
- propagateTrueState(condition2);
- thenStatement2.accept(this);
+ propagateTrueState(condition);
+ thenStatement.accept(this);
} finally {
thenOverrides = _overrideManager.captureLocalOverrides();
_overrideManager.exitScope();
}
}
Map<Element, Type2> elseOverrides = null;
- Statement elseStatement2 = node.elseStatement;
- if (elseStatement2 != null) {
+ Statement elseStatement = node.elseStatement;
+ if (elseStatement != null) {
try {
_overrideManager.enterScope();
- propagateFalseState(condition2);
- elseStatement2.accept(this);
+ propagateFalseState(condition);
+ elseStatement.accept(this);
} finally {
elseOverrides = _overrideManager.captureLocalOverrides();
_overrideManager.exitScope();
@@ -5158,15 +5158,15 @@ class ResolverVisitor extends ScopedVisitor {
}
node.accept(_elementResolver);
node.accept(_typeAnalyzer);
- bool thenIsAbrupt = isAbruptTermination2(thenStatement2);
- bool elseIsAbrupt = isAbruptTermination2(elseStatement2);
+ bool thenIsAbrupt = isAbruptTermination2(thenStatement);
+ bool elseIsAbrupt = isAbruptTermination2(elseStatement);
if (elseIsAbrupt && !thenIsAbrupt) {
- propagateTrueState(condition2);
+ propagateTrueState(condition);
if (thenOverrides != null) {
_overrideManager.applyOverrides(thenOverrides);
}
} else if (thenIsAbrupt && !elseIsAbrupt) {
- propagateFalseState(condition2);
+ propagateFalseState(condition);
if (elseOverrides != null) {
_overrideManager.applyOverrides(elseOverrides);
}
@@ -5254,14 +5254,14 @@ class ResolverVisitor extends ScopedVisitor {
}
Object visitTypeName(TypeName node) => null;
Object visitWhileStatement(WhileStatement node) {
- Expression condition2 = node.condition;
- safelyVisit(condition2);
- Statement body2 = node.body;
- if (body2 != null) {
+ Expression condition = node.condition;
+ safelyVisit(condition);
+ Statement body = node.body;
+ if (body != null) {
try {
_overrideManager.enterScope();
- propagateTrueState(condition2);
- body2.accept(this);
+ propagateTrueState(condition);
+ body.accept(this);
} finally {
_overrideManager.exitScope();
}
@@ -5328,21 +5328,21 @@ class ResolverVisitor extends ScopedVisitor {
}
}
void visitForEachStatementInScope(ForEachStatement node) {
- Expression iterator2 = node.iterator;
- safelyVisit(iterator2);
- DeclaredIdentifier loopVariable2 = node.loopVariable;
- safelyVisit(loopVariable2);
- Statement body2 = node.body;
- if (body2 != null) {
+ Expression iterator = node.iterator;
+ safelyVisit(iterator);
+ DeclaredIdentifier loopVariable = node.loopVariable;
+ safelyVisit(loopVariable);
+ Statement body = node.body;
+ if (body != null) {
try {
_overrideManager.enterScope();
- if (loopVariable2 != null && iterator2 != null) {
- LocalVariableElement loopElement = loopVariable2.element;
+ if (loopVariable != null && iterator != null) {
+ LocalVariableElement loopElement = loopVariable.element;
if (loopElement != null) {
- override(loopElement, getIteratorElementType(iterator2));
+ override(loopElement, getIteratorElementType(iterator));
}
}
- body2.accept(this);
+ body.accept(this);
} finally {
_overrideManager.exitScope();
}
@@ -5433,12 +5433,12 @@ class ResolverVisitor extends ScopedVisitor {
} else if (statement is ExpressionStatement) {
return isAbruptTermination(((statement as ExpressionStatement)).expression);
} else if (statement is Block) {
- NodeList<Statement> statements2 = ((statement as Block)).statements;
- int size2 = statements2.length;
- if (size2 == 0) {
+ NodeList<Statement> statements = ((statement as Block)).statements;
+ int size = statements.length;
+ if (size == 0) {
return false;
}
- return isAbruptTermination2(statements2[size2 - 1]);
+ return isAbruptTermination2(statements[size - 1]);
}
return false;
}
@@ -5570,9 +5570,9 @@ abstract class ScopedVisitor extends GeneralizingASTVisitor<Object> {
_jtd_constructor_275_impl(Library library, Source source2, TypeProvider typeProvider2) {
this._definingLibrary = library.libraryElement;
this._source = source2;
- LibraryScope libraryScope2 = library.libraryScope;
- this._errorListener = libraryScope2.errorListener;
- this._nameScope = libraryScope2;
+ LibraryScope libraryScope = library.libraryScope;
+ this._errorListener = libraryScope.errorListener;
+ this._nameScope = libraryScope;
this._typeProvider = typeProvider2;
}
@@ -5666,9 +5666,9 @@ abstract class ScopedVisitor extends GeneralizingASTVisitor<Object> {
return null;
}
Object visitDeclaredIdentifier(DeclaredIdentifier node) {
- VariableElement element2 = node.element;
- if (element2 != null) {
- _nameScope.define(element2);
+ VariableElement element = node.element;
+ if (element != null) {
+ _nameScope.define(element);
}
super.visitDeclaredIdentifier(node);
return null;
@@ -5810,9 +5810,9 @@ abstract class ScopedVisitor extends GeneralizingASTVisitor<Object> {
}
Object visitVariableDeclaration(VariableDeclaration node) {
if (node.parent.parent is! TopLevelVariableDeclaration && node.parent.parent is! FieldDeclaration) {
- VariableElement element2 = node.element;
- if (element2 != null) {
- _nameScope.define(element2);
+ VariableElement element = node.element;
+ if (element != null) {
+ _nameScope.define(element);
}
}
super.visitVariableDeclaration(node);
@@ -6121,13 +6121,13 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
* <i>e<sub>3</sub></i>.</blockquote>
*/
Object visitAssignmentExpression(AssignmentExpression node) {
- sc.TokenType operator2 = node.operator.type;
- if (identical(operator2, sc.TokenType.EQ)) {
- Expression rightHandSide2 = node.rightHandSide;
- Type2 staticType = getStaticType(rightHandSide2);
+ sc.TokenType operator = node.operator.type;
+ if (identical(operator, sc.TokenType.EQ)) {
+ Expression rightHandSide = node.rightHandSide;
+ Type2 staticType = getStaticType(rightHandSide);
recordStaticType(node, staticType);
Type2 overrideType = staticType;
- Type2 propagatedType = getPropagatedType(rightHandSide2);
+ Type2 propagatedType = getPropagatedType(rightHandSide);
if (propagatedType != null) {
if (propagatedType.isMoreSpecificThan(staticType)) {
recordPropagatedType(node, propagatedType);
@@ -6390,11 +6390,11 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
*/
Object visitInstanceCreationExpression(InstanceCreationExpression node) {
recordStaticType(node, node.constructorName.type.type);
- ConstructorElement element2 = node.element;
- if (element2 != null && "Element" == element2.enclosingElement.name && "tag" == element2.name) {
- LibraryElement library2 = element2.library;
- if (isHtmlLibrary(library2)) {
- Type2 returnType = getFirstArgumentAsType2(library2, node.argumentList, _HTML_ELEMENT_TO_CLASS_MAP);
+ ConstructorElement element = node.element;
+ if (element != null && "Element" == element.enclosingElement.name && "tag" == element.name) {
+ LibraryElement library = element.library;
+ if (isHtmlLibrary(library)) {
+ Type2 returnType = getFirstArgumentAsType2(library, node.argumentList, _HTML_ELEMENT_TO_CLASS_MAP);
if (returnType != null) {
recordPropagatedType(node, returnType);
}
@@ -6431,11 +6431,11 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
*/
Object visitListLiteral(ListLiteral node) {
Type2 staticType = _dynamicType;
- TypeArgumentList typeArguments2 = node.typeArguments;
- if (typeArguments2 != null) {
- NodeList<TypeName> arguments2 = typeArguments2.arguments;
- if (arguments2 != null && arguments2.length == 1) {
- TypeName argumentTypeName = arguments2[0];
+ TypeArgumentList typeArguments = node.typeArguments;
+ if (typeArguments != null) {
+ NodeList<TypeName> arguments = typeArguments.arguments;
+ if (arguments != null && arguments.length == 1) {
+ TypeName argumentTypeName = arguments[0];
Type2 argumentType = getType2(argumentTypeName);
if (argumentType != null) {
staticType = argumentType;
@@ -6443,12 +6443,12 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
}
}
recordStaticType(node, _typeProvider.listType.substitute5(<Type2> [staticType]));
- NodeList<Expression> elements2 = node.elements;
- int count = elements2.length;
+ NodeList<Expression> elements = node.elements;
+ int count = elements.length;
if (count > 0) {
- Type2 propagatedType = getBestType(elements2[0]);
+ Type2 propagatedType = getBestType(elements[0]);
for (int i = 1; i < count; i++) {
- Type2 elementType = getBestType(elements2[i]);
+ Type2 elementType = getBestType(elements[i]);
if (propagatedType != elementType) {
propagatedType = _dynamicType;
} else {
@@ -6480,16 +6480,16 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
Object visitMapLiteral(MapLiteral node) {
Type2 staticKeyType = _dynamicType;
Type2 staticValueType = _dynamicType;
- TypeArgumentList typeArguments2 = node.typeArguments;
- if (typeArguments2 != null) {
- NodeList<TypeName> arguments2 = typeArguments2.arguments;
- if (arguments2 != null && arguments2.length == 2) {
- TypeName entryKeyTypeName = arguments2[0];
+ TypeArgumentList typeArguments = node.typeArguments;
+ if (typeArguments != null) {
+ NodeList<TypeName> arguments = typeArguments.arguments;
+ if (arguments != null && arguments.length == 2) {
+ TypeName entryKeyTypeName = arguments[0];
Type2 entryKeyType = getType2(entryKeyTypeName);
if (entryKeyType != null) {
staticKeyType = entryKeyType;
}
- TypeName entryValueTypeName = arguments2[1];
+ TypeName entryValueTypeName = arguments[1];
Type2 entryValueType = getType2(entryValueTypeName);
if (entryValueType != null) {
staticValueType = entryValueType;
@@ -6497,14 +6497,14 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
}
}
recordStaticType(node, _typeProvider.mapType.substitute5(<Type2> [staticKeyType, staticValueType]));
- NodeList<MapLiteralEntry> entries2 = node.entries;
- int count = entries2.length;
+ NodeList<MapLiteralEntry> entries = node.entries;
+ int count = entries.length;
if (count > 0) {
- MapLiteralEntry entry = entries2[0];
+ MapLiteralEntry entry = entries[0];
Type2 propagatedKeyType = getBestType(entry.key);
Type2 propagatedValueType = getBestType(entry.value);
for (int i = 1; i < count; i++) {
- entry = entries2[i];
+ entry = entries[i];
Type2 elementKeyType = getBestType(entry.key);
if (propagatedKeyType != elementKeyType) {
propagatedKeyType = _dynamicType;
@@ -6589,9 +6589,9 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
if (target != null) {
Type2 targetType = getBestType(target);
if (targetType is InterfaceType && (targetType.name == "HtmlDocument" || targetType.name == "Document")) {
- LibraryElement library2 = targetType.element.library;
- if (isHtmlLibrary(library2)) {
- Type2 returnType = getFirstArgumentAsType(library2, node.argumentList);
+ LibraryElement library = targetType.element.library;
+ if (isHtmlLibrary(library)) {
+ Type2 returnType = getFirstArgumentAsType(library, node.argumentList);
if (returnType != null) {
recordPropagatedType(node, returnType);
}
@@ -6603,9 +6603,9 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
if (target == null) {
Element methodElement = methodNameNode.element;
if (methodElement != null) {
- LibraryElement library3 = methodElement.library;
- if (isHtmlLibrary(library3)) {
- Type2 returnType = getFirstArgumentAsQuery(library3, node.argumentList);
+ LibraryElement library = methodElement.library;
+ if (isHtmlLibrary(library)) {
+ Type2 returnType = getFirstArgumentAsQuery(library, node.argumentList);
if (returnType != null) {
recordPropagatedType(node, returnType);
}
@@ -6614,9 +6614,9 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
} else {
Type2 targetType = getBestType(target);
if (targetType is InterfaceType && (targetType.name == "HtmlDocument" || targetType.name == "Document")) {
- LibraryElement library4 = targetType.element.library;
- if (isHtmlLibrary(library4)) {
- Type2 returnType = getFirstArgumentAsQuery(library4, node.argumentList);
+ LibraryElement library = targetType.element.library;
+ if (isHtmlLibrary(library)) {
+ Type2 returnType = getFirstArgumentAsQuery(library, node.argumentList);
if (returnType != null) {
recordPropagatedType(node, returnType);
}
@@ -6627,9 +6627,9 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
Expression target = node.realTarget;
Type2 targetType = getBestType(target);
if (targetType is InterfaceType && (targetType.name == "HtmlDocument" || targetType.name == "Document")) {
- LibraryElement library5 = targetType.element.library;
- if (isHtmlLibrary(library5)) {
- Type2 returnType = getFirstArgumentAsQuery(library5, node.argumentList);
+ LibraryElement library = targetType.element.library;
+ if (isHtmlLibrary(library)) {
+ Type2 returnType = getFirstArgumentAsQuery(library, node.argumentList);
if (returnType != null) {
recordPropagatedType(node, returnType);
}
@@ -6652,9 +6652,9 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
return null;
}
Object visitNamedExpression(NamedExpression node) {
- Expression expression2 = node.expression;
- recordStaticType(node, getStaticType(expression2));
- recordPropagatedType(node, getPropagatedType(expression2));
+ Expression expression = node.expression;
+ recordStaticType(node, getStaticType(expression));
+ recordPropagatedType(node, getPropagatedType(expression));
return null;
}
@@ -6667,9 +6667,9 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
return null;
}
Object visitParenthesizedExpression(ParenthesizedExpression node) {
- Expression expression2 = node.expression;
- recordStaticType(node, getStaticType(expression2));
- recordPropagatedType(node, getPropagatedType(expression2));
+ Expression expression = node.expression;
+ recordStaticType(node, getStaticType(expression));
+ recordPropagatedType(node, getPropagatedType(expression));
return null;
}
@@ -6700,17 +6700,17 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
* = r - 1; return r}(e1, e2)</i></blockquote>
*/
Object visitPostfixExpression(PostfixExpression node) {
- Expression operand2 = node.operand;
- Type2 staticType = getStaticType(operand2);
- sc.TokenType operator2 = node.operator.type;
- if (identical(operator2, sc.TokenType.MINUS_MINUS) || identical(operator2, sc.TokenType.PLUS_PLUS)) {
- Type2 intType2 = _typeProvider.intType;
- if (identical(getStaticType(node.operand), intType2)) {
- staticType = intType2;
+ Expression operand = node.operand;
+ Type2 staticType = getStaticType(operand);
+ sc.TokenType operator = node.operator.type;
+ if (identical(operator, sc.TokenType.MINUS_MINUS) || identical(operator, sc.TokenType.PLUS_PLUS)) {
+ Type2 intType = _typeProvider.intType;
+ if (identical(getStaticType(node.operand), intType)) {
+ staticType = intType;
}
}
recordStaticType(node, staticType);
- recordPropagatedType(node, getPropagatedType(operand2));
+ recordPropagatedType(node, getPropagatedType(operand));
return null;
}
@@ -6719,30 +6719,30 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
*/
Object visitPrefixedIdentifier(PrefixedIdentifier node) {
SimpleIdentifier prefixedIdentifier = node.identifier;
- Element element2 = prefixedIdentifier.element;
+ Element element = prefixedIdentifier.element;
Type2 staticType = _dynamicType;
- if (element2 is ClassElement) {
+ if (element is ClassElement) {
if (isNotTypeLiteral(node)) {
- staticType = ((element2 as ClassElement)).type;
+ staticType = ((element as ClassElement)).type;
} else {
staticType = _typeProvider.typeType;
}
- } else if (element2 is FunctionTypeAliasElement) {
- staticType = ((element2 as FunctionTypeAliasElement)).type;
- } else if (element2 is MethodElement) {
- staticType = ((element2 as MethodElement)).type;
- } else if (element2 is PropertyAccessorElement) {
- staticType = getType((element2 as PropertyAccessorElement), node.prefix.staticType);
- } else if (element2 is ExecutableElement) {
- staticType = ((element2 as ExecutableElement)).type;
- } else if (element2 is TypeVariableElement) {
- staticType = ((element2 as TypeVariableElement)).type;
- } else if (element2 is VariableElement) {
- staticType = ((element2 as VariableElement)).type;
+ } else if (element is FunctionTypeAliasElement) {
+ staticType = ((element as FunctionTypeAliasElement)).type;
+ } else if (element is MethodElement) {
+ staticType = ((element as MethodElement)).type;
+ } else if (element is PropertyAccessorElement) {
+ staticType = getType((element as PropertyAccessorElement), node.prefix.staticType);
+ } else if (element is ExecutableElement) {
+ staticType = ((element as ExecutableElement)).type;
+ } else if (element is TypeVariableElement) {
+ staticType = ((element as TypeVariableElement)).type;
+ } else if (element is VariableElement) {
+ staticType = ((element as VariableElement)).type;
}
recordStaticType(prefixedIdentifier, staticType);
recordStaticType(node, staticType);
- Type2 propagatedType = _overrideManager.getType(element2);
+ Type2 propagatedType = _overrideManager.getType(element);
if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
recordPropagatedType(prefixedIdentifier, propagatedType);
recordPropagatedType(node, propagatedType);
@@ -6756,16 +6756,16 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
* form <i>op super</i> is equivalent to the method invocation <i>super.op()<i>.</blockquote>
*/
Object visitPrefixExpression(PrefixExpression node) {
- sc.TokenType operator2 = node.operator.type;
- if (identical(operator2, sc.TokenType.BANG)) {
+ sc.TokenType operator = node.operator.type;
+ if (identical(operator, sc.TokenType.BANG)) {
recordStaticType(node, _typeProvider.boolType);
} else {
ExecutableElement staticMethodElement = node.staticElement;
Type2 staticType = computeReturnType(staticMethodElement);
- if (identical(operator2, sc.TokenType.MINUS_MINUS) || identical(operator2, sc.TokenType.PLUS_PLUS)) {
- Type2 intType2 = _typeProvider.intType;
- if (identical(getStaticType(node.operand), intType2)) {
- staticType = intType2;
+ if (identical(operator, sc.TokenType.MINUS_MINUS) || identical(operator, sc.TokenType.PLUS_PLUS)) {
+ Type2 intType = _typeProvider.intType;
+ if (identical(getStaticType(node.operand), intType)) {
+ staticType = intType;
}
}
recordStaticType(node, staticType);
@@ -6824,18 +6824,18 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
* The static type of <i>i</i> is the declared return type of <i>m</i>.</blockquote>
*/
Object visitPropertyAccess(PropertyAccess node) {
- SimpleIdentifier propertyName2 = node.propertyName;
- Element element2 = propertyName2.element;
+ SimpleIdentifier propertyName = node.propertyName;
+ Element element = propertyName.element;
Type2 staticType = _dynamicType;
- if (element2 is MethodElement) {
- staticType = ((element2 as MethodElement)).type;
- } else if (element2 is PropertyAccessorElement) {
- staticType = getType((element2 as PropertyAccessorElement), node.target != null ? getStaticType(node.target) : null);
+ if (element is MethodElement) {
+ staticType = ((element as MethodElement)).type;
+ } else if (element is PropertyAccessorElement) {
+ staticType = getType((element as PropertyAccessorElement), node.target != null ? getStaticType(node.target) : null);
} else {
}
- recordStaticType(propertyName2, staticType);
+ recordStaticType(propertyName, staticType);
recordStaticType(node, staticType);
- Type2 propagatedType = _overrideManager.getType(element2);
+ Type2 propagatedType = _overrideManager.getType(element);
if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
recordPropagatedType(node, propagatedType);
}
@@ -6894,33 +6894,33 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
* </blockquote>
*/
Object visitSimpleIdentifier(SimpleIdentifier node) {
- Element element2 = node.element;
+ Element element = node.element;
Type2 staticType = _dynamicType;
- if (element2 is ClassElement) {
+ if (element is ClassElement) {
if (isNotTypeLiteral(node)) {
- staticType = ((element2 as ClassElement)).type;
+ staticType = ((element as ClassElement)).type;
} else {
staticType = _typeProvider.typeType;
}
- } else if (element2 is FunctionTypeAliasElement) {
- staticType = ((element2 as FunctionTypeAliasElement)).type;
- } else if (element2 is MethodElement) {
- staticType = ((element2 as MethodElement)).type;
- } else if (element2 is PropertyAccessorElement) {
- staticType = getType((element2 as PropertyAccessorElement), null);
- } else if (element2 is ExecutableElement) {
- staticType = ((element2 as ExecutableElement)).type;
- } else if (element2 is TypeVariableElement) {
- staticType = ((element2 as TypeVariableElement)).type;
- } else if (element2 is VariableElement) {
- staticType = ((element2 as VariableElement)).type;
- } else if (element2 is PrefixElement) {
+ } else if (element is FunctionTypeAliasElement) {
+ staticType = ((element as FunctionTypeAliasElement)).type;
+ } else if (element is MethodElement) {
+ staticType = ((element as MethodElement)).type;
+ } else if (element is PropertyAccessorElement) {
+ staticType = getType((element as PropertyAccessorElement), null);
+ } else if (element is ExecutableElement) {
+ staticType = ((element as ExecutableElement)).type;
+ } else if (element is TypeVariableElement) {
+ staticType = ((element as TypeVariableElement)).type;
+ } else if (element is VariableElement) {
+ staticType = ((element as VariableElement)).type;
+ } else if (element is PrefixElement) {
return null;
} else {
staticType = _dynamicType;
}
recordStaticType(node, staticType);
- Type2 propagatedType = _overrideManager.getType(element2);
+ Type2 propagatedType = _overrideManager.getType(element);
if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
recordPropagatedType(node, propagatedType);
}
@@ -6973,12 +6973,12 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
return null;
}
Object visitVariableDeclaration(VariableDeclaration node) {
- Expression initializer2 = node.initializer;
- if (initializer2 != null) {
- Type2 rightType = getBestType(initializer2);
- VariableElement element2 = node.name.element as VariableElement;
- if (element2 != null) {
- _resolver.override(element2, rightType);
+ Expression initializer = node.initializer;
+ if (initializer != null) {
+ Type2 rightType = getBestType(initializer);
+ VariableElement element = node.name.element as VariableElement;
+ if (element != null) {
+ _resolver.override(element, rightType);
}
}
return null;
@@ -6991,9 +6991,9 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
*/
Type2 computeArgumentType(ExecutableElement element) {
if (element != null) {
- List<ParameterElement> parameters2 = element.parameters;
- if (parameters2 != null && parameters2.length == 2) {
- return parameters2[1].type;
+ List<ParameterElement> parameters = element.parameters;
+ if (parameters != null && parameters.length == 2) {
+ return parameters[1].type;
}
}
return _dynamicType;
@@ -7008,31 +7008,31 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
if (element is PropertyAccessorElement) {
FunctionType propertyType = ((element as PropertyAccessorElement)).type;
if (propertyType != null) {
- Type2 returnType2 = propertyType.returnType;
- if (returnType2 is InterfaceType) {
- if (identical(returnType2, _typeProvider.functionType)) {
+ Type2 returnType = propertyType.returnType;
+ if (returnType is InterfaceType) {
+ if (identical(returnType, _typeProvider.functionType)) {
return _dynamicType;
}
- MethodElement callMethod = ((returnType2 as InterfaceType)).lookUpMethod(ElementResolver.CALL_METHOD_NAME, _resolver.definingLibrary);
+ MethodElement callMethod = ((returnType as InterfaceType)).lookUpMethod(ElementResolver.CALL_METHOD_NAME, _resolver.definingLibrary);
if (callMethod != null) {
return callMethod.type.returnType;
}
- } else if (returnType2 is FunctionType) {
- Type2 innerReturnType = ((returnType2 as FunctionType)).returnType;
+ } else if (returnType is FunctionType) {
+ Type2 innerReturnType = ((returnType as FunctionType)).returnType;
if (innerReturnType != null) {
return innerReturnType;
}
- } else if (returnType2.isDartCoreFunction()) {
+ } else if (returnType.isDartCoreFunction()) {
return _dynamicType;
}
- if (returnType2 != null) {
- return returnType2;
+ if (returnType != null) {
+ return returnType;
}
}
} else if (element is ExecutableElement) {
- FunctionType type2 = ((element as ExecutableElement)).type;
- if (type2 != null) {
- return type2.returnType;
+ FunctionType type = ((element as ExecutableElement)).type;
+ if (type != null) {
+ return type.returnType;
}
} else if (element is VariableElement) {
Type2 variableType = ((element as VariableElement)).type;
@@ -7051,11 +7051,11 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
* @return the return type that was computed
*/
Type2 computeReturnType2(FunctionDeclaration node) {
- TypeName returnType2 = node.returnType;
- if (returnType2 == null) {
+ TypeName returnType = node.returnType;
+ if (returnType == null) {
return _dynamicType;
}
- return returnType2.type;
+ return returnType.type;
}
/**
@@ -7066,9 +7066,9 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
* @return the return type that was computed
*/
Type2 computeReturnType3(FunctionExpression node) {
- FunctionBody body2 = node.body;
- if (body2 is ExpressionFunctionBody) {
- return getStaticType(((body2 as ExpressionFunctionBody)).expression);
+ FunctionBody body = node.body;
+ if (body is ExpressionFunctionBody) {
+ return getStaticType(((body as ExpressionFunctionBody)).expression);
}
return _dynamicType;
}
@@ -7125,9 +7125,9 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
* @return the string specified by the first argument in the argument list
*/
String getFirstArgumentAsString(ArgumentList argumentList) {
- NodeList<Expression> arguments2 = argumentList.arguments;
- if (arguments2.length > 0) {
- Expression argument = arguments2[0];
+ NodeList<Expression> arguments = argumentList.arguments;
+ if (arguments.length > 0) {
+ Expression argument = arguments[0];
if (argument is SimpleStringLiteral) {
return ((argument as SimpleStringLiteral)).value;
}
@@ -7208,29 +7208,29 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
if (parameterTypes != null && parameterTypes.length > 0) {
return parameterTypes[0];
}
- PropertyAccessorElement getter2 = accessor.variable.getter;
- if (getter2 != null) {
- functionType = getter2.type;
+ PropertyAccessorElement getter = accessor.variable.getter;
+ if (getter != null) {
+ functionType = getter.type;
if (functionType != null) {
return functionType.returnType;
}
}
return _dynamicType;
}
- Type2 returnType2 = functionType.returnType;
- if (returnType2 is TypeVariableType && context is InterfaceType) {
+ Type2 returnType = functionType.returnType;
+ if (returnType is TypeVariableType && context is InterfaceType) {
InterfaceType interfaceTypeContext = (context as InterfaceType);
List<TypeVariableElement> parameterElements = interfaceTypeContext.element != null ? interfaceTypeContext.element.typeVariables : null;
if (parameterElements != null) {
for (int i = 0; i < parameterElements.length; i++) {
TypeVariableElement varElt = parameterElements[i];
- if (returnType2.name == varElt.name) {
+ if (returnType.name == varElt.name) {
return interfaceTypeContext.typeArguments[i];
}
}
}
}
- return returnType2;
+ return returnType;
}
/**
@@ -7239,11 +7239,11 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
* @return the type represented by the type name
*/
Type2 getType2(TypeName typeName) {
- Type2 type2 = typeName.type;
- if (type2 == null) {
+ Type2 type = typeName.type;
+ if (type == null) {
return _dynamicType;
}
- return type2;
+ return type;
}
/**
@@ -7259,8 +7259,8 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
* @return {@code true} if the given node is not a type literal
*/
bool isNotTypeLiteral(Identifier node) {
- ASTNode parent2 = node.parent;
- return parent2 is TypeName || (parent2 is PrefixedIdentifier && (parent2.parent is TypeName || identical(((parent2 as PrefixedIdentifier)).prefix, node))) || (parent2 is PropertyAccess && identical(((parent2 as PropertyAccess)).target, node)) || (parent2 is MethodInvocation && identical(node, ((parent2 as MethodInvocation)).target));
+ ASTNode parent = node.parent;
+ return parent is TypeName || (parent is PrefixedIdentifier && (parent.parent is TypeName || identical(((parent as PrefixedIdentifier)).prefix, node))) || (parent is PropertyAccess && identical(((parent as PropertyAccess)).target, node)) || (parent is MethodInvocation && identical(node, ((parent as MethodInvocation)).target));
}
/**
@@ -7294,20 +7294,20 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
* @return the better type guess, or the same static type as given
*/
Type2 refineBinaryExpressionType(BinaryExpression node, Type2 staticType) {
- sc.TokenType operator2 = node.operator.type;
- if (identical(operator2, sc.TokenType.AMPERSAND_AMPERSAND) || identical(operator2, sc.TokenType.BAR_BAR) || identical(operator2, sc.TokenType.EQ_EQ) || identical(operator2, sc.TokenType.BANG_EQ)) {
+ sc.TokenType operator = node.operator.type;
+ if (identical(operator, sc.TokenType.AMPERSAND_AMPERSAND) || identical(operator, sc.TokenType.BAR_BAR) || identical(operator, sc.TokenType.EQ_EQ) || identical(operator, sc.TokenType.BANG_EQ)) {
return _typeProvider.boolType;
}
- if (identical(operator2, sc.TokenType.MINUS) || identical(operator2, sc.TokenType.PERCENT) || identical(operator2, sc.TokenType.PLUS) || identical(operator2, sc.TokenType.STAR)) {
- Type2 doubleType2 = _typeProvider.doubleType;
- if (identical(getStaticType(node.leftOperand), doubleType2) || identical(getStaticType(node.rightOperand), doubleType2)) {
- return doubleType2;
+ if (identical(operator, sc.TokenType.MINUS) || identical(operator, sc.TokenType.PERCENT) || identical(operator, sc.TokenType.PLUS) || identical(operator, sc.TokenType.STAR)) {
+ Type2 doubleType = _typeProvider.doubleType;
+ if (identical(getStaticType(node.leftOperand), doubleType) || identical(getStaticType(node.rightOperand), doubleType)) {
+ return doubleType;
}
}
- if (identical(operator2, sc.TokenType.MINUS) || identical(operator2, sc.TokenType.PERCENT) || identical(operator2, sc.TokenType.PLUS) || identical(operator2, sc.TokenType.STAR) || identical(operator2, sc.TokenType.TILDE_SLASH)) {
- Type2 intType2 = _typeProvider.intType;
- if (identical(getStaticType(node.leftOperand), intType2) && identical(getStaticType(node.rightOperand), intType2)) {
- staticType = intType2;
+ if (identical(operator, sc.TokenType.MINUS) || identical(operator, sc.TokenType.PERCENT) || identical(operator, sc.TokenType.PLUS) || identical(operator, sc.TokenType.STAR) || identical(operator, sc.TokenType.TILDE_SLASH)) {
+ Type2 intType = _typeProvider.intType;
+ if (identical(getStaticType(node.leftOperand), intType) && identical(getStaticType(node.rightOperand), intType)) {
+ staticType = intType;
}
}
return staticType;
@@ -7486,11 +7486,11 @@ class TypeOverrideManager_TypeOverrideScope {
Map<Element, Type2> overrides = new Map<Element, Type2>();
if (variableList.isConst() || variableList.isFinal()) {
for (VariableDeclaration variable in variableList.variables) {
- Element element2 = variable.element;
- if (element2 != null) {
- Type2 type = _overridenTypes[element2];
+ Element element = variable.element;
+ if (element != null) {
+ Type2 type = _overridenTypes[element];
if (type != null) {
- overrides[element2] = type;
+ overrides[element] = type;
}
}
}
@@ -7800,9 +7800,9 @@ class TypeResolverVisitor extends ScopedVisitor {
exceptionType = getType3(exceptionTypeName);
}
recordType(exception, exceptionType);
- Element element2 = exception.element;
- if (element2 is VariableElementImpl) {
- ((element2 as VariableElementImpl)).type = exceptionType;
+ Element element = exception.element;
+ if (element is VariableElementImpl) {
+ ((element as VariableElementImpl)).type = exceptionType;
} else {
}
}
@@ -7817,19 +7817,19 @@ class TypeResolverVisitor extends ScopedVisitor {
super.visitClassDeclaration(node);
ClassElementImpl classElement = getClassElement(node.name);
InterfaceType superclassType = null;
- ExtendsClause extendsClause2 = node.extendsClause;
- if (extendsClause2 != null) {
+ ExtendsClause extendsClause = node.extendsClause;
+ if (extendsClause != null) {
ErrorCode errorCode = node.withClause == null ? CompileTimeErrorCode.EXTENDS_NON_CLASS : CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS;
- superclassType = resolveType(extendsClause2.superclass, errorCode);
+ superclassType = resolveType(extendsClause.superclass, errorCode);
if (superclassType != typeProvider.objectType) {
classElement.validMixin = false;
}
}
if (classElement != null) {
if (superclassType == null) {
- InterfaceType objectType2 = typeProvider.objectType;
- if (classElement.type != objectType2) {
- superclassType = objectType2;
+ InterfaceType objectType = typeProvider.objectType;
+ if (classElement.type != objectType) {
+ superclassType = objectType;
}
}
classElement.supertype = superclassType;
@@ -7853,11 +7853,11 @@ class TypeResolverVisitor extends ScopedVisitor {
}
Object visitConstructorDeclaration(ConstructorDeclaration node) {
super.visitConstructorDeclaration(node);
- ExecutableElementImpl element2 = node.element as ExecutableElementImpl;
- FunctionTypeImpl type = new FunctionTypeImpl.con1(element2);
- setTypeInformation(type, null, element2.parameters);
- type.returnType = ((element2.enclosingElement as ClassElement)).type;
- element2.type = type;
+ ExecutableElementImpl element = node.element as ExecutableElementImpl;
+ FunctionTypeImpl type = new FunctionTypeImpl.con1(element);
+ setTypeInformation(type, null, element.parameters);
+ type.returnType = ((element.enclosingElement as ClassElement)).type;
+ element.type = type;
return null;
}
Object visitDeclaredIdentifier(DeclaredIdentifier node) {
@@ -7869,8 +7869,8 @@ class TypeResolverVisitor extends ScopedVisitor {
} else {
declaredType = getType3(typeName);
}
- LocalVariableElementImpl element2 = node.element as LocalVariableElementImpl;
- element2.type = declaredType;
+ LocalVariableElementImpl element = node.element as LocalVariableElementImpl;
+ element.type = declaredType;
return null;
}
Object visitDefaultFormalParameter(DefaultFormalParameter node) {
@@ -7879,9 +7879,9 @@ class TypeResolverVisitor extends ScopedVisitor {
}
Object visitFieldFormalParameter(FieldFormalParameter node) {
super.visitFieldFormalParameter(node);
- Element element2 = node.identifier.element;
- if (element2 is ParameterElementImpl) {
- ParameterElementImpl parameter = element2 as ParameterElementImpl;
+ Element element = node.identifier.element;
+ if (element is ParameterElementImpl) {
+ ParameterElementImpl parameter = element as ParameterElementImpl;
Type2 type;
TypeName typeName = node.type;
if (typeName == null) {
@@ -7896,44 +7896,44 @@ class TypeResolverVisitor extends ScopedVisitor {
}
Object visitFunctionDeclaration(FunctionDeclaration node) {
super.visitFunctionDeclaration(node);
- ExecutableElementImpl element2 = node.element as ExecutableElementImpl;
- FunctionTypeImpl type = new FunctionTypeImpl.con1(element2);
- setTypeInformation(type, node.returnType, element2.parameters);
- element2.type = type;
+ ExecutableElementImpl element = node.element as ExecutableElementImpl;
+ FunctionTypeImpl type = new FunctionTypeImpl.con1(element);
+ setTypeInformation(type, node.returnType, element.parameters);
+ element.type = type;
return null;
}
Object visitFunctionTypeAlias(FunctionTypeAlias node) {
super.visitFunctionTypeAlias(node);
- FunctionTypeAliasElementImpl element2 = node.element as FunctionTypeAliasElementImpl;
- FunctionTypeImpl type2 = element2.type as FunctionTypeImpl;
- setTypeInformation(type2, node.returnType, element2.parameters);
+ FunctionTypeAliasElementImpl element = node.element as FunctionTypeAliasElementImpl;
+ FunctionTypeImpl type = element.type as FunctionTypeImpl;
+ setTypeInformation(type, node.returnType, element.parameters);
return null;
}
Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
super.visitFunctionTypedFormalParameter(node);
- ParameterElementImpl element2 = node.identifier.element as ParameterElementImpl;
+ ParameterElementImpl element = node.identifier.element as ParameterElementImpl;
AnonymousFunctionTypeImpl type = new AnonymousFunctionTypeImpl();
- List<ParameterElement> parameters2 = getElements(node.parameters);
- setTypeInformation(type, node.returnType, parameters2);
- type.baseParameters = parameters2;
- element2.type = type;
+ List<ParameterElement> parameters = getElements(node.parameters);
+ setTypeInformation(type, node.returnType, parameters);
+ type.baseParameters = parameters;
+ element.type = type;
return null;
}
Object visitMethodDeclaration(MethodDeclaration node) {
super.visitMethodDeclaration(node);
- ExecutableElementImpl element2 = node.element as ExecutableElementImpl;
- FunctionTypeImpl type = new FunctionTypeImpl.con1(element2);
- setTypeInformation(type, node.returnType, element2.parameters);
- element2.type = type;
- if (element2 is PropertyAccessorElement) {
- PropertyAccessorElement accessor = element2 as PropertyAccessorElement;
- PropertyInducingElementImpl variable2 = accessor.variable as PropertyInducingElementImpl;
+ ExecutableElementImpl element = node.element as ExecutableElementImpl;
+ FunctionTypeImpl type = new FunctionTypeImpl.con1(element);
+ setTypeInformation(type, node.returnType, element.parameters);
+ element.type = type;
+ if (element is PropertyAccessorElement) {
+ PropertyAccessorElement accessor = element as PropertyAccessorElement;
+ PropertyInducingElementImpl variable = accessor.variable as PropertyInducingElementImpl;
if (accessor.isGetter()) {
- variable2.type = type.returnType;
- } else if (variable2.type == null) {
+ variable.type = type.returnType;
+ } else if (variable.type == null) {
List<Type2> parameterTypes = type.normalParameterTypes;
if (parameterTypes != null && parameterTypes.length > 0) {
- variable2.type = parameterTypes[0];
+ variable.type = parameterTypes[0];
}
}
}
@@ -7948,9 +7948,9 @@ class TypeResolverVisitor extends ScopedVisitor {
} else {
declaredType = getType3(typeName);
}
- Element element2 = node.identifier.element;
- if (element2 is ParameterElement) {
- ((element2 as ParameterElementImpl)).type = declaredType;
+ Element element = node.identifier.element;
+ if (element is ParameterElement) {
+ ((element as ParameterElementImpl)).type = declaredType;
} else {
}
return null;
@@ -7981,19 +7981,19 @@ class TypeResolverVisitor extends ScopedVisitor {
node.type = voidType;
return null;
}
- ASTNode parent2 = node.parent;
- if (typeName is PrefixedIdentifier && parent2 is ConstructorName && argumentList == null) {
- ConstructorName name = parent2 as ConstructorName;
+ ASTNode parent = node.parent;
+ if (typeName is PrefixedIdentifier && parent is ConstructorName && argumentList == null) {
+ ConstructorName name = parent as ConstructorName;
if (name.name == null) {
- SimpleIdentifier prefix2 = ((typeName as PrefixedIdentifier)).prefix;
- element = nameScope.lookup(prefix2, definingLibrary);
+ SimpleIdentifier prefix = ((typeName as PrefixedIdentifier)).prefix;
+ element = nameScope.lookup(prefix, definingLibrary);
if (element is PrefixElement) {
return null;
} else if (element != null) {
name.name = ((typeName as PrefixedIdentifier)).identifier;
name.period = ((typeName as PrefixedIdentifier)).period;
- node.name = prefix2;
- typeName = prefix2;
+ node.name = prefix;
+ typeName = prefix;
}
}
}
@@ -8065,11 +8065,11 @@ class TypeResolverVisitor extends ScopedVisitor {
} else if (isTypeNameInIsExpression(node)) {
reportError(StaticWarningCode.TYPE_TEST_NON_TYPE, typeName, [typeName.name]);
} else {
- ASTNode parent3 = typeName.parent;
- while (parent3 is TypeName) {
- parent3 = parent3.parent;
+ ASTNode parent = typeName.parent;
+ while (parent is TypeName) {
+ parent = parent.parent;
}
- if (parent3 is ExtendsClause || parent3 is ImplementsClause || parent3 is WithClause || parent3 is ClassTypeAlias) {
+ if (parent is ExtendsClause || parent is ImplementsClause || parent is WithClause || parent is ClassTypeAlias) {
} else {
reportError(StaticWarningCode.NOT_A_TYPE, typeName, [typeName.name]);
}
@@ -8080,14 +8080,14 @@ class TypeResolverVisitor extends ScopedVisitor {
return null;
}
if (argumentList != null) {
- NodeList<TypeName> arguments2 = argumentList.arguments;
- int argumentCount = arguments2.length;
+ NodeList<TypeName> arguments = argumentList.arguments;
+ int argumentCount = arguments.length;
List<Type2> parameters = getTypeArguments(type);
int parameterCount = parameters.length;
int count = Math.min(argumentCount, parameterCount);
List<Type2> typeArguments = new List<Type2>();
for (int i = 0; i < count; i++) {
- Type2 argumentType = getType3(arguments2[i]);
+ Type2 argumentType = getType3(arguments[i]);
if (argumentType != null) {
typeArguments.add(argumentType);
}
@@ -8134,21 +8134,21 @@ class TypeResolverVisitor extends ScopedVisitor {
} else {
declaredType = getType3(typeName);
}
- Element element2 = node.name.element;
- if (element2 is VariableElement) {
- ((element2 as VariableElementImpl)).type = declaredType;
- if (element2 is PropertyInducingElement) {
- PropertyInducingElement variableElement = element2 as PropertyInducingElement;
- PropertyAccessorElementImpl getter2 = variableElement.getter as PropertyAccessorElementImpl;
- FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter2);
+ Element element = node.name.element;
+ if (element is VariableElement) {
+ ((element as VariableElementImpl)).type = declaredType;
+ if (element is PropertyInducingElement) {
+ PropertyInducingElement variableElement = element as PropertyInducingElement;
+ PropertyAccessorElementImpl getter = variableElement.getter as PropertyAccessorElementImpl;
+ FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
getterType.returnType = declaredType;
- getter2.type = getterType;
- PropertyAccessorElementImpl setter2 = variableElement.setter as PropertyAccessorElementImpl;
- if (setter2 != null) {
- FunctionTypeImpl setterType = new FunctionTypeImpl.con1(setter2);
+ getter.type = getterType;
+ PropertyAccessorElementImpl setter = variableElement.setter as PropertyAccessorElementImpl;
+ if (setter != null) {
+ FunctionTypeImpl setterType = new FunctionTypeImpl.con1(setter);
setterType.returnType = VoidTypeImpl.instance;
setterType.normalParameterTypes = <Type2> [declaredType];
- setter2.type = setterType;
+ setter.type = setterType;
}
}
} else {
@@ -8165,11 +8165,11 @@ class TypeResolverVisitor extends ScopedVisitor {
if (identifier == null) {
return null;
}
- Element element2 = identifier.element;
- if (element2 is! ClassElementImpl) {
+ Element element = identifier.element;
+ if (element is! ClassElementImpl) {
return null;
}
- return element2 as ClassElementImpl;
+ return element as ClassElementImpl;
}
/**
@@ -8181,9 +8181,9 @@ class TypeResolverVisitor extends ScopedVisitor {
List<ParameterElement> getElements(FormalParameterList parameterList) {
List<ParameterElement> elements = new List<ParameterElement>();
for (FormalParameter parameter in parameterList.parameters) {
- ParameterElement element2 = parameter.identifier.element as ParameterElement;
- if (element2 != null) {
- elements.add(element2);
+ ParameterElement element = parameter.identifier.element as ParameterElement;
+ if (element != null) {
+ elements.add(element);
}
}
return new List.from(elements);
@@ -8198,11 +8198,11 @@ class TypeResolverVisitor extends ScopedVisitor {
* were provided
*/
ErrorCode getInvalidTypeParametersErrorCode(TypeName node) {
- ASTNode parent2 = node.parent;
- if (parent2 is ConstructorName) {
- parent2 = parent2.parent;
- if (parent2 is InstanceCreationExpression) {
- if (((parent2 as InstanceCreationExpression)).isConst()) {
+ ASTNode parent = node.parent;
+ if (parent is ConstructorName) {
+ parent = parent.parent;
+ if (parent is InstanceCreationExpression) {
+ if (((parent as InstanceCreationExpression)).isConst()) {
return CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS;
} else {
return CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS;
@@ -8237,11 +8237,11 @@ class TypeResolverVisitor extends ScopedVisitor {
* @return the type represented by the type name
*/
Type2 getType3(TypeName typeName) {
- Type2 type2 = typeName.type;
- if (type2 == null) {
+ Type2 type = typeName.type;
+ if (type == null) {
return _dynamicType;
}
- return type2;
+ return type;
}
/**
@@ -8277,9 +8277,9 @@ class TypeResolverVisitor extends ScopedVisitor {
* @return {@code true} if the given type name is used as the type in an as expression
*/
bool isTypeNameInAsExpression(TypeName typeName) {
- ASTNode parent2 = typeName.parent;
- if (parent2 is AsExpression) {
- AsExpression asExpression = parent2 as AsExpression;
+ ASTNode parent = typeName.parent;
+ if (parent is AsExpression) {
+ AsExpression asExpression = parent as AsExpression;
return identical(asExpression.type, typeName);
}
return false;
@@ -8291,9 +8291,9 @@ class TypeResolverVisitor extends ScopedVisitor {
* @return {@code true} if the given type name is used as the exception type in a catch clause
*/
bool isTypeNameInCatchClause(TypeName typeName) {
- ASTNode parent2 = typeName.parent;
- if (parent2 is CatchClause) {
- CatchClause catchClause = parent2 as CatchClause;
+ ASTNode parent = typeName.parent;
+ if (parent is CatchClause) {
+ CatchClause catchClause = parent as CatchClause;
return identical(catchClause.exceptionType, typeName);
}
return false;
@@ -8306,9 +8306,9 @@ class TypeResolverVisitor extends ScopedVisitor {
* expression
*/
bool isTypeNameInInstanceCreationExpression(TypeName typeName) {
- ASTNode parent2 = typeName.parent;
- if (parent2 is ConstructorName && parent2.parent is InstanceCreationExpression) {
- ConstructorName constructorName = parent2 as ConstructorName;
+ ASTNode parent = typeName.parent;
+ if (parent is ConstructorName && parent.parent is InstanceCreationExpression) {
+ ConstructorName constructorName = parent as ConstructorName;
return constructorName != null && identical(constructorName.type, typeName);
}
return false;
@@ -8320,9 +8320,9 @@ class TypeResolverVisitor extends ScopedVisitor {
* @return {@code true} if the given type name is used as the type in an is expression
*/
bool isTypeNameInIsExpression(TypeName typeName) {
- ASTNode parent2 = typeName.parent;
- if (parent2 is IsExpression) {
- IsExpression isExpression = parent2 as IsExpression;
+ ASTNode parent = typeName.parent;
+ if (parent is IsExpression) {
+ IsExpression isExpression = parent as IsExpression;
return identical(isExpression.type, typeName);
}
return false;
@@ -8334,12 +8334,12 @@ class TypeResolverVisitor extends ScopedVisitor {
* @return {@code true} if the given type name is used as the type in a redirected constructor
*/
bool isTypeNameTargetInRedirectedConstructor(TypeName typeName) {
- ASTNode parent2 = typeName.parent;
- if (parent2 is ConstructorName) {
- ConstructorName constructorName = parent2 as ConstructorName;
- parent2 = constructorName.parent;
- if (parent2 is ConstructorDeclaration) {
- ConstructorDeclaration constructorDeclaration = parent2 as ConstructorDeclaration;
+ ASTNode parent = typeName.parent;
+ if (parent is ConstructorName) {
+ ConstructorName constructorName = parent as ConstructorName;
+ parent = constructorName.parent;
+ if (parent is ConstructorDeclaration) {
+ ConstructorDeclaration constructorDeclaration = parent as ConstructorDeclaration;
return constructorName == constructorDeclaration.redirectedConstructor;
}
}
@@ -8370,15 +8370,15 @@ class TypeResolverVisitor extends ScopedVisitor {
*/
void resolve(ClassElementImpl classElement, WithClause withClause, ImplementsClause implementsClause) {
if (withClause != null) {
- List<InterfaceType> mixinTypes2 = resolveTypes(withClause.mixinTypes, CompileTimeErrorCode.MIXIN_OF_NON_CLASS);
+ List<InterfaceType> mixinTypes = resolveTypes(withClause.mixinTypes, CompileTimeErrorCode.MIXIN_OF_NON_CLASS);
if (classElement != null) {
- classElement.mixins = mixinTypes2;
+ classElement.mixins = mixinTypes;
}
}
if (implementsClause != null) {
- NodeList<TypeName> interfaces2 = implementsClause.interfaces;
- List<InterfaceType> interfaceTypes = resolveTypes(interfaces2, CompileTimeErrorCode.IMPLEMENTS_NON_CLASS);
- List<TypeName> typeNames = new List.from(interfaces2);
+ NodeList<TypeName> interfaces = implementsClause.interfaces;
+ List<InterfaceType> interfaceTypes = resolveTypes(interfaces, CompileTimeErrorCode.IMPLEMENTS_NON_CLASS);
+ List<TypeName> typeNames = new List.from(interfaces);
String dynamicKeyword = sc.Keyword.DYNAMIC.syntax;
List<bool> detectedRepeatOnIndex = new List<bool>.filled(typeNames.length, false);
for (int i = 0; i < detectedRepeatOnIndex.length; i++) {
@@ -8386,18 +8386,18 @@ class TypeResolverVisitor extends ScopedVisitor {
}
for (int i = 0; i < typeNames.length; i++) {
TypeName typeName = typeNames[i];
- String name3 = typeName.name.name;
- if (name3 == dynamicKeyword) {
+ String name = typeName.name.name;
+ if (name == dynamicKeyword) {
reportError(CompileTimeErrorCode.IMPLEMENTS_DYNAMIC, typeName, []);
}
if (!detectedRepeatOnIndex[i]) {
for (int j = i + 1; j < typeNames.length; j++) {
- Element element3 = typeName.name.element;
+ Element element = typeName.name.element;
TypeName typeName2 = typeNames[j];
Identifier identifier2 = typeName2.name;
String name2 = identifier2.name;
Element element2 = identifier2.element;
- if (element3 != null && element3 == element2) {
+ if (element != null && element == element2) {
detectedRepeatOnIndex[j] = true;
reportError(CompileTimeErrorCode.IMPLEMENTS_REPEATED, typeName2, [name2]);
}
@@ -8418,13 +8418,13 @@ class TypeResolverVisitor extends ScopedVisitor {
* @return the type specified by the type name
*/
InterfaceType resolveType(TypeName typeName, ErrorCode nonTypeError) {
- Type2 type2 = typeName.type;
- if (type2 is InterfaceType) {
- return type2 as InterfaceType;
+ Type2 type = typeName.type;
+ if (type is InterfaceType) {
+ return type as InterfaceType;
}
- Identifier name2 = typeName.name;
- if (name2.name != sc.Keyword.DYNAMIC.syntax) {
- reportError(nonTypeError, name2, [name2.name]);
+ Identifier name = typeName.name;
+ if (name.name != sc.Keyword.DYNAMIC.syntax) {
+ reportError(nonTypeError, name, [name.name]);
}
return null;
}
@@ -8455,11 +8455,11 @@ class TypeResolverVisitor extends ScopedVisitor {
PrefixedIdentifier identifier = typeName as PrefixedIdentifier;
identifier.identifier.staticElement = element2;
identifier.identifier.element = element2;
- SimpleIdentifier prefix2 = identifier.prefix;
- Element prefixElement = nameScope.lookup(prefix2, definingLibrary);
+ SimpleIdentifier prefix = identifier.prefix;
+ Element prefixElement = nameScope.lookup(prefix, definingLibrary);
if (prefixElement != null) {
- prefix2.staticElement = prefixElement;
- prefix2.element = prefixElement;
+ prefix.staticElement = prefixElement;
+ prefix.element = prefixElement;
}
}
}
@@ -8611,8 +8611,8 @@ class FunctionScope extends EnclosedScope {
void defineParameters(ExecutableElement functionElement) {
Scope parameterScope = enclosingScope;
if (functionElement.enclosingElement is ExecutableElement) {
- String name2 = functionElement.name;
- if (name2 != null && !name2.isEmpty) {
+ String name = functionElement.name;
+ if (name != null && !name.isEmpty) {
parameterScope.define(functionElement);
}
}
@@ -8755,32 +8755,32 @@ class LibraryImportScope extends Scope {
* @return {@code true} if the given {@link Identifier} is the part of type annotation.
*/
static bool isTypeAnnotation(Identifier identifier) {
- ASTNode parent4 = identifier.parent;
- if (parent4 is TypeName) {
- ASTNode parent2 = parent4.parent;
+ ASTNode parent = identifier.parent;
+ if (parent is TypeName) {
+ ASTNode parent2 = parent.parent;
if (parent2 is FunctionDeclaration) {
FunctionDeclaration decl = parent2 as FunctionDeclaration;
- return identical(decl.returnType, parent4);
+ return identical(decl.returnType, parent);
}
if (parent2 is FunctionTypeAlias) {
FunctionTypeAlias decl = parent2 as FunctionTypeAlias;
- return identical(decl.returnType, parent4);
+ return identical(decl.returnType, parent);
}
if (parent2 is MethodDeclaration) {
MethodDeclaration decl = parent2 as MethodDeclaration;
- return identical(decl.returnType, parent4);
+ return identical(decl.returnType, parent);
}
if (parent2 is VariableDeclarationList) {
VariableDeclarationList decl = parent2 as VariableDeclarationList;
- return identical(decl.type, parent4);
+ return identical(decl.type, parent);
}
if (parent2 is SimpleFormalParameter) {
SimpleFormalParameter decl = parent2 as SimpleFormalParameter;
- return identical(decl.type, parent4);
+ return identical(decl.type, parent);
}
if (parent2 is TypeParameter) {
TypeParameter decl = parent2 as TypeParameter;
- return identical(decl.bound, parent4);
+ return identical(decl.bound, parent);
}
if (parent2 is TypeArgumentList) {
ASTNode parent3 = parent2.parent;
@@ -8999,11 +8999,11 @@ class NamespaceBuilder {
* @return the export namespace that was created
*/
Namespace createExportNamespace(ExportElement element) {
- LibraryElement exportedLibrary2 = element.exportedLibrary;
- if (exportedLibrary2 == null) {
+ LibraryElement exportedLibrary = element.exportedLibrary;
+ if (exportedLibrary == null) {
return Namespace.EMPTY;
}
- Map<String, Element> definedNames = createExportMapping(exportedLibrary2, new Set<LibraryElement>());
+ Map<String, Element> definedNames = createExportMapping(exportedLibrary, new Set<LibraryElement>());
definedNames = apply(definedNames, element.combinators);
return new Namespace(definedNames);
}
@@ -9021,11 +9021,11 @@ class NamespaceBuilder {
* @return the import namespace that was created
*/
Namespace createImportNamespace(ImportElement element) {
- LibraryElement importedLibrary2 = element.importedLibrary;
- if (importedLibrary2 == null) {
+ LibraryElement importedLibrary = element.importedLibrary;
+ if (importedLibrary == null) {
return Namespace.EMPTY;
}
- Map<String, Element> definedNames = createExportMapping(importedLibrary2, new Set<LibraryElement>());
+ Map<String, Element> definedNames = createExportMapping(importedLibrary, new Set<LibraryElement>());
definedNames = apply(definedNames, element.combinators);
definedNames = apply2(definedNames, element.prefix);
return new Namespace(definedNames);
@@ -9073,9 +9073,9 @@ class NamespaceBuilder {
* @param element the element to be added
*/
void addIfPublic(Map<String, Element> definedNames, Element element) {
- String name2 = element.name;
- if (name2 != null && !Scope.isPrivateName(name2)) {
- definedNames[name2] = element;
+ String name = element.name;
+ if (name != null && !Scope.isPrivateName(name)) {
+ definedNames[name] = element;
}
}
@@ -9150,9 +9150,9 @@ class NamespaceBuilder {
try {
Map<String, Element> definedNames = new Map<String, Element>();
for (ExportElement element in library.exports) {
- LibraryElement exportedLibrary2 = element.exportedLibrary;
- if (exportedLibrary2 != null && !visitedElements.contains(exportedLibrary2)) {
- Map<String, Element> exportedNames = createExportMapping(exportedLibrary2, visitedElements);
+ LibraryElement exportedLibrary = element.exportedLibrary;
+ if (exportedLibrary != null && !visitedElements.contains(exportedLibrary)) {
+ Map<String, Element> exportedNames = createExportMapping(exportedLibrary, visitedElements);
exportedNames = apply(exportedNames, element.combinators);
addAll(definedNames, exportedNames);
}
@@ -9294,11 +9294,11 @@ abstract class Scope {
* @return the error code used to report duplicate names within a scope
*/
AnalysisError getErrorForDuplicate(Element existing, Element duplicate) {
- Source source2 = duplicate.source;
- if (source2 == null) {
- source2 = source;
+ Source source = duplicate.source;
+ if (source == null) {
+ source = source;
}
- return new AnalysisError.con2(source2, duplicate.nameOffset, duplicate.displayName.length, CompileTimeErrorCode.DUPLICATE_DEFINITION, [existing.displayName]);
+ return new AnalysisError.con2(source, duplicate.nameOffset, duplicate.displayName.length, CompileTimeErrorCode.DUPLICATE_DEFINITION, [existing.displayName]);
}
/**
@@ -9427,26 +9427,26 @@ class ConstantVerifier extends RecursiveASTVisitor<Object> {
Set<Object> keys = new Set<Object>();
List<Expression> invalidKeys = new List<Expression>();
for (MapLiteralEntry entry in node.entries) {
- Expression key2 = entry.key;
+ Expression key = entry.key;
if (isConst) {
- EvaluationResultImpl result = validate(key2, CompileTimeErrorCode.NON_CONSTANT_MAP_KEY);
+ EvaluationResultImpl result = validate(key, CompileTimeErrorCode.NON_CONSTANT_MAP_KEY);
validate(entry.value, CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE);
if (result is ValidResult) {
- Object value2 = ((result as ValidResult)).value;
- if (keys.contains(value2)) {
- invalidKeys.add(key2);
+ Object value = ((result as ValidResult)).value;
+ if (keys.contains(value)) {
+ invalidKeys.add(key);
} else {
- javaSetAdd(keys, value2);
+ javaSetAdd(keys, value);
}
}
} else {
- EvaluationResultImpl result = key2.accept(new ConstantVisitor());
+ EvaluationResultImpl result = key.accept(new ConstantVisitor());
if (result is ValidResult) {
- Object value3 = ((result as ValidResult)).value;
- if (keys.contains(value3)) {
- invalidKeys.add(key2);
+ Object value = ((result as ValidResult)).value;
+ if (keys.contains(value)) {
+ invalidKeys.add(key);
} else {
- javaSetAdd(keys, value3);
+ javaSetAdd(keys, value);
}
} else {
reportEqualKeys = false;
@@ -9472,13 +9472,13 @@ class ConstantVerifier extends RecursiveASTVisitor<Object> {
}
Object visitVariableDeclaration(VariableDeclaration node) {
super.visitVariableDeclaration(node);
- Expression initializer2 = node.initializer;
- if (initializer2 != null && node.isConst()) {
- VariableElementImpl element2 = node.element as VariableElementImpl;
- EvaluationResultImpl result = element2.evaluationResult;
+ Expression initializer = node.initializer;
+ if (initializer != null && node.isConst()) {
+ VariableElementImpl element = node.element as VariableElementImpl;
+ EvaluationResultImpl result = element.evaluationResult;
if (result == null) {
- result = validate(initializer2, CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE);
- element2.evaluationResult = result;
+ result = validate(initializer, CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE);
+ element.evaluationResult = result;
} else if (result is ErrorResult) {
reportErrors(result, CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE);
}
@@ -9536,11 +9536,11 @@ class ConstantVerifier extends RecursiveASTVisitor<Object> {
if (!node.isConst()) {
return;
}
- ArgumentList argumentList2 = node.argumentList;
- if (argumentList2 == null) {
+ ArgumentList argumentList = node.argumentList;
+ if (argumentList == null) {
return;
}
- for (Expression argument in argumentList2.arguments) {
+ for (Expression argument in argumentList.arguments) {
if (argument is NamedExpression) {
argument = ((argument as NamedExpression)).expression;
}
@@ -9560,12 +9560,12 @@ class ConstantVerifier extends RecursiveASTVisitor<Object> {
for (FormalParameter parameter in parameters2.parameters) {
if (parameter is DefaultFormalParameter) {
DefaultFormalParameter defaultParameter = parameter as DefaultFormalParameter;
- Expression defaultValue2 = defaultParameter.defaultValue;
- if (defaultValue2 != null) {
- EvaluationResultImpl result = validate(defaultValue2, CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE);
+ Expression defaultValue = defaultParameter.defaultValue;
+ if (defaultValue != null) {
+ EvaluationResultImpl result = validate(defaultValue, CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE);
if (defaultParameter.isConst()) {
- VariableElementImpl element2 = parameter.element as VariableElementImpl;
- element2.evaluationResult = result;
+ VariableElementImpl element = parameter.element as VariableElementImpl;
+ element.evaluationResult = result;
}
}
}
@@ -9605,8 +9605,8 @@ class ConstantVerifier extends RecursiveASTVisitor<Object> {
*/
void validateInitializers(ConstructorDeclaration constructor) {
List<ParameterElement> parameterElements = constructor.parameters.elements;
- NodeList<ConstructorInitializer> initializers2 = constructor.initializers;
- for (ConstructorInitializer initializer in initializers2) {
+ NodeList<ConstructorInitializer> initializers = constructor.initializers;
+ for (ConstructorInitializer initializer in initializers) {
if (initializer is ConstructorFieldInitializer) {
ConstructorFieldInitializer fieldInitializer = initializer as ConstructorFieldInitializer;
validateInitializerExpression(parameterElements, fieldInitializer.expression);
@@ -9627,24 +9627,24 @@ class ConstantVisitor_10 extends ConstantVisitor {
List<ParameterElement> parameterElements;
ConstantVisitor_10(this.ConstantVerifier_this, this.parameterElements) : super();
EvaluationResultImpl visitSimpleIdentifier(SimpleIdentifier node) {
- Element element2 = node.element;
+ Element element = node.element;
for (ParameterElement parameterElement in parameterElements) {
- if (identical(parameterElement, element2) && parameterElement != null) {
- Type2 type2 = parameterElement.type;
- if (type2 != null) {
- if (type2.isDynamic()) {
+ if (identical(parameterElement, element) && parameterElement != null) {
+ Type2 type = parameterElement.type;
+ if (type != null) {
+ if (type.isDynamic()) {
return ValidResult.RESULT_DYNAMIC;
}
- if (type2.isSubtypeOf(ConstantVerifier_this._boolType)) {
+ if (type.isSubtypeOf(ConstantVerifier_this._boolType)) {
return ValidResult.RESULT_BOOL;
}
- if (type2.isSubtypeOf(ConstantVerifier_this._intType)) {
+ if (type.isSubtypeOf(ConstantVerifier_this._intType)) {
return ValidResult.RESULT_INT;
}
- if (type2.isSubtypeOf(ConstantVerifier_this._numType)) {
+ if (type.isSubtypeOf(ConstantVerifier_this._numType)) {
return ValidResult.RESULT_NUM;
}
- if (type2.isSubtypeOf(ConstantVerifier_this._stringType)) {
+ if (type.isSubtypeOf(ConstantVerifier_this._stringType)) {
return ValidResult.RESULT_STRING;
}
}
@@ -9801,8 +9801,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
return super.visitAssertStatement(node);
}
Object visitAssignmentExpression(AssignmentExpression node) {
- sc.Token operator2 = node.operator;
- sc.TokenType operatorType = operator2.type;
+ sc.Token operator = node.operator;
+ sc.TokenType operatorType = operator.type;
if (identical(operatorType, sc.TokenType.EQ)) {
checkForInvalidAssignment2(node.leftHandSide, node.rightHandSide);
} else {
@@ -9828,14 +9828,14 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
ClassElement outerClass = _enclosingClass;
try {
_enclosingClass = node.element;
- WithClause withClause2 = node.withClause;
- ImplementsClause implementsClause2 = node.implementsClause;
- ExtendsClause extendsClause2 = node.extendsClause;
+ WithClause withClause = node.withClause;
+ ImplementsClause implementsClause = node.implementsClause;
+ ExtendsClause extendsClause = node.extendsClause;
checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME);
checkForMemberWithClassName();
- checkForAllMixinErrorCodes(withClause2);
- if (implementsClause2 != null || extendsClause2 != null) {
- if (!checkForImplementsDisallowedClass(implementsClause2) && !checkForExtendsDisallowedClass(extendsClause2)) {
+ checkForAllMixinErrorCodes(withClause);
+ if (implementsClause != null || extendsClause != null) {
+ if (!checkForImplementsDisallowedClass(implementsClause) && !checkForExtendsDisallowedClass(extendsClause)) {
checkForNonAbstractClassInheritsAbstractMember(node);
checkForInconsistentMethodInheritance();
checkForRecursiveInterfaceInheritance(_enclosingClass, new List<ClassElement>());
@@ -9944,12 +9944,12 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (node.isSetter() || node.isGetter()) {
checkForMismatchedAccessorTypes(node, methoName);
if (node.isSetter()) {
- FunctionExpression functionExpression2 = node.functionExpression;
- if (functionExpression2 != null) {
- checkForWrongNumberOfParametersForSetter(node.name, functionExpression2.parameters);
+ FunctionExpression functionExpression = node.functionExpression;
+ if (functionExpression != null) {
+ checkForWrongNumberOfParametersForSetter(node.name, functionExpression.parameters);
}
- TypeName returnType2 = node.returnType;
- checkForNonVoidReturnTypeForSetter(returnType2);
+ TypeName returnType = node.returnType;
+ checkForNonVoidReturnTypeForSetter(returnType);
}
}
return super.visitFunctionDeclaration(node);
@@ -9985,11 +9985,11 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
return super.visitIndexExpression(node);
}
Object visitInstanceCreationExpression(InstanceCreationExpression node) {
- ConstructorName constructorName2 = node.constructorName;
- TypeName typeName = constructorName2.type;
- Type2 type2 = typeName.type;
- if (type2 is InterfaceType) {
- InterfaceType interfaceType = type2 as InterfaceType;
+ ConstructorName constructorName = node.constructorName;
+ TypeName typeName = constructorName.type;
+ Type2 type = typeName.type;
+ if (type is InterfaceType) {
+ InterfaceType interfaceType = type as InterfaceType;
checkForConstOrNewWithAbstractClass(node, typeName, interfaceType);
if (node.isConst()) {
checkForConstWithNonConst(node);
@@ -9998,30 +9998,30 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
} else {
checkForNewWithUndefinedConstructor(node);
}
- checkForTypeArgumentNotMatchingBounds(node, constructorName2.element, typeName);
+ checkForTypeArgumentNotMatchingBounds(node, constructorName.element, typeName);
}
return super.visitInstanceCreationExpression(node);
}
Object visitListLiteral(ListLiteral node) {
if (node.modifier != null) {
- TypeArgumentList typeArguments2 = node.typeArguments;
- if (typeArguments2 != null) {
- NodeList<TypeName> arguments2 = typeArguments2.arguments;
- if (arguments2.length != 0) {
- checkForInvalidTypeArgumentInConstTypedLiteral(arguments2, CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST);
+ TypeArgumentList typeArguments = node.typeArguments;
+ if (typeArguments != null) {
+ NodeList<TypeName> arguments = typeArguments.arguments;
+ if (arguments.length != 0) {
+ checkForInvalidTypeArgumentInConstTypedLiteral(arguments, CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST);
}
}
}
return super.visitListLiteral(node);
}
Object visitMapLiteral(MapLiteral node) {
- TypeArgumentList typeArguments2 = node.typeArguments;
- if (typeArguments2 != null) {
- NodeList<TypeName> arguments2 = typeArguments2.arguments;
- if (arguments2.length != 0) {
- checkForInvalidTypeArgumentForKey(arguments2);
+ TypeArgumentList typeArguments = node.typeArguments;
+ if (typeArguments != null) {
+ NodeList<TypeName> arguments = typeArguments.arguments;
+ if (arguments.length != 0) {
+ checkForInvalidTypeArgumentForKey(arguments);
if (node.modifier != null) {
- checkForInvalidTypeArgumentInConstTypedLiteral(arguments2, CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP);
+ checkForInvalidTypeArgumentInConstTypedLiteral(arguments, CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP);
}
}
}
@@ -10146,14 +10146,14 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
Expression initializerNode = node.initializer;
checkForInvalidAssignment2(nameNode, initializerNode);
nameNode.accept(this);
- String name2 = nameNode.name;
- javaSetAdd(_namesForReferenceToDeclaredVariableInInitializer, name2);
+ String name = nameNode.name;
+ javaSetAdd(_namesForReferenceToDeclaredVariableInInitializer, name);
try {
if (initializerNode != null) {
initializerNode.accept(this);
}
} finally {
- _namesForReferenceToDeclaredVariableInInitializer.remove(name2);
+ _namesForReferenceToDeclaredVariableInInitializer.remove(name);
}
return null;
}
@@ -10209,27 +10209,27 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
}
}
}
- NodeList<ConstructorInitializer> initializers2 = node.initializers;
- for (ConstructorInitializer constructorInitializer in initializers2) {
+ NodeList<ConstructorInitializer> initializers = node.initializers;
+ for (ConstructorInitializer constructorInitializer in initializers) {
if (constructorInitializer is ConstructorFieldInitializer) {
ConstructorFieldInitializer constructorFieldInitializer = constructorInitializer as ConstructorFieldInitializer;
- SimpleIdentifier fieldName2 = constructorFieldInitializer.fieldName;
- Element element2 = fieldName2.element;
- if (element2 is FieldElement) {
- FieldElement fieldElement = element2 as FieldElement;
+ SimpleIdentifier fieldName = constructorFieldInitializer.fieldName;
+ Element element = fieldName.element;
+ if (element is FieldElement) {
+ FieldElement fieldElement = element as FieldElement;
INIT_STATE state = fieldElementsMap[fieldElement];
if (identical(state, INIT_STATE.NOT_INIT)) {
fieldElementsMap[fieldElement] = INIT_STATE.INIT_IN_INITIALIZERS;
} else if (identical(state, INIT_STATE.INIT_IN_DECLARATION)) {
if (fieldElement.isFinal() || fieldElement.isConst()) {
- _errorReporter.reportError2(CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, fieldName2, []);
+ _errorReporter.reportError2(CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, fieldName, []);
foundError = true;
}
} else if (identical(state, INIT_STATE.INIT_IN_FIELD_FORMAL)) {
- _errorReporter.reportError2(CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, fieldName2, []);
+ _errorReporter.reportError2(CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, fieldName, []);
foundError = true;
} else if (identical(state, INIT_STATE.INIT_IN_INITIALIZERS)) {
- _errorReporter.reportError2(CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, fieldName2, [fieldElement.displayName]);
+ _errorReporter.reportError2(CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, fieldName, [fieldElement.displayName]);
foundError = true;
}
}
@@ -10526,8 +10526,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
return false;
}
ExportElement exportElement = node.element as ExportElement;
- LibraryElement exportedLibrary2 = exportElement.exportedLibrary;
- if (exportedLibrary2 == null) {
+ LibraryElement exportedLibrary = exportElement.exportedLibrary;
+ if (exportedLibrary == null) {
return false;
}
Namespace namespace = new NamespaceBuilder().createExportNamespace(exportElement);
@@ -10535,7 +10535,7 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
for (String name in newNames) {
ExportElement prevElement = _exportedNames[name];
if (prevElement != null && prevElement != exportElement) {
- _errorReporter.reportError2(CompileTimeErrorCode.AMBIGUOUS_EXPORT, node, [name, prevElement.exportedLibrary.definingCompilationUnit.displayName, exportedLibrary2.definingCompilationUnit.displayName]);
+ _errorReporter.reportError2(CompileTimeErrorCode.AMBIGUOUS_EXPORT, node, [name, prevElement.exportedLibrary.definingCompilationUnit.displayName, exportedLibrary.definingCompilationUnit.displayName]);
return true;
} else {
_exportedNames[name] = exportElement;
@@ -10551,10 +10551,10 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @see CompileTimeErrorCode#ARGUMENT_DEFINITION_TEST_NON_PARAMETER
*/
bool checkForArgumentDefinitionTestNonParameter(ArgumentDefinitionTest node) {
- SimpleIdentifier identifier2 = node.identifier;
- Element element2 = identifier2.element;
- if (element2 != null && element2 is! ParameterElement) {
- _errorReporter.reportError2(CompileTimeErrorCode.ARGUMENT_DEFINITION_TEST_NON_PARAMETER, identifier2, [identifier2.name]);
+ SimpleIdentifier identifier = node.identifier;
+ Element element = identifier.element;
+ if (element != null && element is! ParameterElement) {
+ _errorReporter.reportError2(CompileTimeErrorCode.ARGUMENT_DEFINITION_TEST_NON_PARAMETER, identifier, [identifier.name]);
return true;
}
return false;
@@ -10587,8 +10587,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (argument == null) {
return false;
}
- ParameterElement staticParameterElement2 = argument.staticParameterElement;
- Type2 staticParameterType = staticParameterElement2 == null ? null : staticParameterElement2.type;
+ ParameterElement staticParameterElement = argument.staticParameterElement;
+ Type2 staticParameterType = staticParameterElement == null ? null : staticParameterElement.type;
Type2 staticArgumentType = getStaticType(argument);
if (staticArgumentType == null || staticParameterType == null) {
return false;
@@ -10673,8 +10673,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME
*/
bool checkForBuiltInIdentifierAsName(SimpleIdentifier identifier, ErrorCode errorCode) {
- sc.Token token2 = identifier.token;
- if (identical(token2.type, sc.TokenType.KEYWORD)) {
+ sc.Token token = identifier.token;
+ if (identical(token.type, sc.TokenType.KEYWORD)) {
_errorReporter.reportError2(errorCode, identifier, [identifier.name]);
return true;
}
@@ -10693,9 +10693,9 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
Identifier identifier = typeName.name;
if (identifier is SimpleIdentifier) {
SimpleIdentifier simpleIdentifier = identifier as SimpleIdentifier;
- sc.Token token2 = simpleIdentifier.token;
- if (identical(token2.type, sc.TokenType.KEYWORD)) {
- if (((token2 as sc.KeywordToken)).keyword != sc.Keyword.DYNAMIC) {
+ sc.Token token = simpleIdentifier.token;
+ if (identical(token.type, sc.TokenType.KEYWORD)) {
+ if (((token as sc.KeywordToken)).keyword != sc.Keyword.DYNAMIC) {
_errorReporter.reportError2(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, identifier, [identifier.name]);
return true;
}
@@ -10713,25 +10713,25 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @see StaticWarningCode#CASE_BLOCK_NOT_TERMINATED
*/
bool checkForCaseBlockNotTerminated(SwitchCase node) {
- NodeList<Statement> statements2 = node.statements;
- if (statements2.isEmpty) {
- ASTNode parent2 = node.parent;
- if (parent2 is SwitchStatement) {
- SwitchStatement switchStatement = parent2 as SwitchStatement;
- NodeList<SwitchMember> members2 = switchStatement.members;
- int index = members2.indexOf(node);
- if (index != -1 && index < members2.length - 1) {
+ NodeList<Statement> statements = node.statements;
+ if (statements.isEmpty) {
+ ASTNode parent = node.parent;
+ if (parent is SwitchStatement) {
+ SwitchStatement switchStatement = parent as SwitchStatement;
+ NodeList<SwitchMember> members = switchStatement.members;
+ int index = members.indexOf(node);
+ if (index != -1 && index < members.length - 1) {
return false;
}
}
} else {
- Statement statement = statements2[statements2.length - 1];
+ Statement statement = statements[statements.length - 1];
if (statement is BreakStatement || statement is ContinueStatement || statement is ReturnStatement) {
return false;
}
if (statement is ExpressionStatement) {
- Expression expression2 = ((statement as ExpressionStatement)).expression;
- if (expression2 is ThrowExpression) {
+ Expression expression = ((statement as ExpressionStatement)).expression;
+ if (expression is ThrowExpression) {
return false;
}
}
@@ -10749,10 +10749,10 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
*/
bool checkForCaseBlocksNotTerminated(SwitchStatement node) {
bool foundError = false;
- NodeList<SwitchMember> members2 = node.members;
- int lastMember = members2.length - 1;
+ NodeList<SwitchMember> members = node.members;
+ int lastMember = members.length - 1;
for (int i = 0; i < lastMember; i++) {
- SwitchMember member = members2[i];
+ SwitchMember member = members[i];
if (member is SwitchCase) {
foundError = javaBooleanOr(foundError, checkForCaseBlockNotTerminated((member as SwitchCase)));
}
@@ -10768,15 +10768,15 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @see CompileTimeErrorCode#CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS
*/
bool checkForCaseExpressionTypeImplementsEquals(SwitchStatement node) {
- Expression expression2 = node.expression;
- Type2 type = getStaticType(expression2);
+ Expression expression = node.expression;
+ Type2 type = getStaticType(expression);
if (type != null && type != _typeProvider.intType && type != _typeProvider.stringType) {
- Element element2 = type.element;
- if (element2 is ClassElement) {
- ClassElement classElement = element2 as ClassElement;
+ Element element = type.element;
+ if (element is ClassElement) {
+ ClassElement classElement = element as ClassElement;
MethodElement method = classElement.lookUpMethod("==", _currentLibrary);
if (method != null && method.enclosingElement.type != _typeProvider.objectType) {
- _errorReporter.reportError2(CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, expression2, [element2.displayName]);
+ _errorReporter.reportError2(CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, expression, [element.displayName]);
return true;
}
}
@@ -10813,34 +10813,34 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
bool checkForConflictingConstructorNameAndMember(ConstructorDeclaration node) {
ConstructorElement constructorElement = node.element;
SimpleIdentifier constructorName = node.name;
- String name2 = constructorElement.name;
+ String name = constructorElement.name;
ClassElement classElement = constructorElement.enclosingElement;
- List<ConstructorElement> constructors2 = classElement.constructors;
- for (ConstructorElement otherConstructor in constructors2) {
+ List<ConstructorElement> constructors = classElement.constructors;
+ for (ConstructorElement otherConstructor in constructors) {
if (identical(otherConstructor, constructorElement)) {
continue;
}
- if (name2 == otherConstructor.name) {
- if (name2 == null || name2.length == 0) {
+ if (name == otherConstructor.name) {
+ if (name == null || name.length == 0) {
_errorReporter.reportError2(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, node, []);
} else {
- _errorReporter.reportError2(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME, node, [name2]);
+ _errorReporter.reportError2(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME, node, [name]);
}
return true;
}
}
if (constructorName != null && constructorElement != null && !constructorName.isSynthetic()) {
- List<FieldElement> fields2 = classElement.fields;
- for (FieldElement field in fields2) {
- if (field.name == name2) {
- _errorReporter.reportError2(CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD, node, [name2]);
+ List<FieldElement> fields = classElement.fields;
+ for (FieldElement field in fields) {
+ if (field.name == name) {
+ _errorReporter.reportError2(CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD, node, [name]);
return true;
}
}
- List<MethodElement> methods2 = classElement.methods;
- for (MethodElement method in methods2) {
- if (method.name == name2) {
- _errorReporter.reportError2(CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD, node, [name2]);
+ List<MethodElement> methods = classElement.methods;
+ for (MethodElement method in methods) {
+ if (method.name == name) {
+ _errorReporter.reportError2(CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD, node, [name]);
return true;
}
}
@@ -10864,18 +10864,18 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (nameNode == null) {
return false;
}
- String name2 = nameNode.name;
+ String name = nameNode.name;
if (_enclosingClass == null) {
return false;
}
InterfaceType enclosingType = _enclosingClass.type;
ExecutableElement superElement;
- superElement = enclosingType.lookUpGetterInSuperclass(name2, _currentLibrary);
+ superElement = enclosingType.lookUpGetterInSuperclass(name, _currentLibrary);
if (superElement == null) {
- superElement = enclosingType.lookUpSetterInSuperclass(name2, _currentLibrary);
+ superElement = enclosingType.lookUpSetterInSuperclass(name, _currentLibrary);
}
if (superElement == null) {
- superElement = enclosingType.lookUpMethodInSuperclass(name2, _currentLibrary);
+ superElement = enclosingType.lookUpMethodInSuperclass(name, _currentLibrary);
}
if (superElement == null) {
return false;
@@ -10908,12 +10908,12 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (nameNode == null) {
return false;
}
- String name2 = nameNode.name;
+ String name = nameNode.name;
if (_enclosingClass == null) {
return false;
}
InterfaceType enclosingType = _enclosingClass.type;
- ExecutableElement setter = enclosingType.lookUpSetter(name2, _currentLibrary);
+ ExecutableElement setter = enclosingType.lookUpSetter(name, _currentLibrary);
if (setter == null) {
return false;
}
@@ -10941,18 +10941,18 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (nameNode == null) {
return false;
}
- String name2 = nameNode.name;
+ String name = nameNode.name;
if (_enclosingClass == null) {
return false;
}
InterfaceType enclosingType = _enclosingClass.type;
ExecutableElement member;
- member = enclosingType.lookUpMethod(name2, _currentLibrary);
+ member = enclosingType.lookUpMethod(name, _currentLibrary);
if (member == null) {
- member = enclosingType.lookUpGetter(name2, _currentLibrary);
+ member = enclosingType.lookUpGetter(name, _currentLibrary);
}
if (member == null) {
- member = enclosingType.lookUpSetter(name2, _currentLibrary);
+ member = enclosingType.lookUpSetter(name, _currentLibrary);
}
if (member == null) {
return false;
@@ -11027,8 +11027,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
*/
bool checkForConstOrNewWithAbstractClass(InstanceCreationExpression node, TypeName typeName, InterfaceType type) {
if (type.element.isAbstract()) {
- ConstructorElement element2 = node.element;
- if (element2 != null && !element2.isFactory()) {
+ ConstructorElement element = node.element;
+ if (element != null && !element.isFactory()) {
if (identical(((node.keyword as sc.KeywordToken)).keyword, sc.Keyword.CONST)) {
_errorReporter.reportError2(StaticWarningCode.CONST_WITH_ABSTRACT_CLASS, typeName, []);
} else {
@@ -11068,11 +11068,11 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @see CompileTimeErrorCode#CONST_WITH_TYPE_PARAMETERS
*/
bool checkForConstWithTypeParameters(InstanceCreationExpression node) {
- ConstructorName constructorName2 = node.constructorName;
- if (constructorName2 == null) {
+ ConstructorName constructorName = node.constructorName;
+ if (constructorName == null) {
return false;
}
- TypeName typeName = constructorName2.type;
+ TypeName typeName = constructorName.type;
return checkForConstWithTypeParameters2(typeName);
}
@@ -11086,17 +11086,17 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (typeName == null) {
return false;
}
- Identifier name2 = typeName.name;
- if (name2 == null) {
+ Identifier name = typeName.name;
+ if (name == null) {
return false;
}
- if (name2.element is TypeVariableElement) {
- _errorReporter.reportError2(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, name2, []);
+ if (name.element is TypeVariableElement) {
+ _errorReporter.reportError2(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, name, []);
}
- TypeArgumentList typeArguments2 = typeName.typeArguments;
- if (typeArguments2 != null) {
+ TypeArgumentList typeArguments = typeName.typeArguments;
+ if (typeArguments != null) {
bool hasError = false;
- for (TypeName argument in typeArguments2.arguments) {
+ for (TypeName argument in typeArguments.arguments) {
hasError = javaBooleanOr(hasError, checkForConstWithTypeParameters2(argument));
}
return hasError;
@@ -11118,20 +11118,20 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (node.element != null) {
return false;
}
- ConstructorName constructorName2 = node.constructorName;
- if (constructorName2 == null) {
+ ConstructorName constructorName = node.constructorName;
+ if (constructorName == null) {
return false;
}
- TypeName type2 = constructorName2.type;
- if (type2 == null) {
+ TypeName type = constructorName.type;
+ if (type == null) {
return false;
}
- Identifier className = type2.name;
- SimpleIdentifier name2 = constructorName2.name;
- if (name2 != null) {
- _errorReporter.reportError2(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, name2, [className, name2]);
+ Identifier className = type.name;
+ SimpleIdentifier name = constructorName.name;
+ if (name != null) {
+ _errorReporter.reportError2(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, name, [className, name]);
} else {
- _errorReporter.reportError2(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, constructorName2, [className]);
+ _errorReporter.reportError2(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, constructorName, [className]);
}
return true;
}
@@ -11145,8 +11145,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
bool checkForDefaultValueInFunctionTypeAlias(FunctionTypeAlias node) {
bool result = false;
FormalParameterList formalParameterList = node.parameters;
- NodeList<FormalParameter> parameters2 = formalParameterList.parameters;
- for (FormalParameter formalParameter in parameters2) {
+ NodeList<FormalParameter> parameters = formalParameterList.parameters;
+ for (FormalParameter formalParameter in parameters) {
if (formalParameter is DefaultFormalParameter) {
DefaultFormalParameter defaultFormalParameter = formalParameter as DefaultFormalParameter;
if (defaultFormalParameter.defaultValue != null) {
@@ -11174,15 +11174,15 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (nodeLibrary == null) {
return false;
}
- String name2 = nodeLibrary.name;
- LibraryElement prevLibrary = _nameToExportElement[name2];
+ String name = nodeLibrary.name;
+ LibraryElement prevLibrary = _nameToExportElement[name];
if (prevLibrary != null) {
if (prevLibrary != nodeLibrary) {
- _errorReporter.reportError2(StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_NAME, node, [prevLibrary.definingCompilationUnit.displayName, nodeLibrary.definingCompilationUnit.displayName, name2]);
+ _errorReporter.reportError2(StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_NAME, node, [prevLibrary.definingCompilationUnit.displayName, nodeLibrary.definingCompilationUnit.displayName, name]);
return true;
}
} else {
- _nameToExportElement[name2] = nodeLibrary;
+ _nameToExportElement[name] = nodeLibrary;
}
return false;
}
@@ -11198,14 +11198,14 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (_isInSystemLibrary) {
return false;
}
- Element element2 = node.element;
- if (element2 is! ExportElement) {
+ Element element = node.element;
+ if (element is! ExportElement) {
return false;
}
- ExportElement exportElement = element2 as ExportElement;
+ ExportElement exportElement = element as ExportElement;
DartSdk sdk = _currentLibrary.context.sourceFactory.dartSdk;
- String uri2 = exportElement.uri;
- SdkLibrary sdkLibrary = sdk.getSdkLibrary(uri2);
+ String uri = exportElement.uri;
+ SdkLibrary sdkLibrary = sdk.getSdkLibrary(uri);
if (sdkLibrary == null) {
return false;
}
@@ -11278,11 +11278,11 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
}
FieldElement fieldElement = fieldNameElement as FieldElement;
Type2 fieldType = fieldElement.type;
- Expression expression2 = node.expression;
- if (expression2 == null) {
+ Expression expression = node.expression;
+ if (expression == null) {
return false;
}
- Type2 staticType = getStaticType(expression2);
+ Type2 staticType = getStaticType(expression);
if (staticType == null) {
return false;
}
@@ -11290,20 +11290,20 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
return false;
} else if (_strictMode) {
if (_isEnclosingConstructorConst) {
- _errorReporter.reportError2(CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, expression2, [staticType.displayName, fieldType.displayName]);
+ _errorReporter.reportError2(CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, expression, [staticType.displayName, fieldType.displayName]);
} else {
- _errorReporter.reportError2(StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, expression2, [staticType.displayName, fieldType.displayName]);
+ _errorReporter.reportError2(StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, expression, [staticType.displayName, fieldType.displayName]);
}
return true;
}
- Type2 propagatedType = getPropagatedType(expression2);
+ Type2 propagatedType = getPropagatedType(expression);
if (propagatedType != null && propagatedType.isAssignableTo(fieldType)) {
return false;
}
if (_isEnclosingConstructorConst) {
- _errorReporter.reportError2(CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, expression2, [(propagatedType == null ? staticType : propagatedType).displayName, fieldType.displayName]);
+ _errorReporter.reportError2(CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, expression, [(propagatedType == null ? staticType : propagatedType).displayName, fieldType.displayName]);
} else {
- _errorReporter.reportError2(StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, expression2, [(propagatedType == null ? staticType : propagatedType).displayName, fieldType.displayName]);
+ _errorReporter.reportError2(StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, expression, [(propagatedType == null ? staticType : propagatedType).displayName, fieldType.displayName]);
}
return true;
}
@@ -11368,8 +11368,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
bool checkForFinalNotInitialized2(VariableDeclarationList node) {
bool foundError = false;
if (!node.isSynthetic() && (node.isConst() || node.isFinal())) {
- NodeList<VariableDeclaration> variables2 = node.variables;
- for (VariableDeclaration variable in variables2) {
+ NodeList<VariableDeclaration> variables = node.variables;
+ for (VariableDeclaration variable in variables) {
if (variable.initializer == null) {
_errorReporter.reportError2(StaticWarningCode.FINAL_NOT_INITIALIZED, variable, [variable.name.name]);
foundError = true;
@@ -11408,34 +11408,34 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (!_isInConstructorInitializer) {
return false;
}
- Element element2 = node.element;
- if (!(element2 is MethodElement || element2 is PropertyAccessorElement)) {
+ Element element = node.element;
+ if (!(element is MethodElement || element is PropertyAccessorElement)) {
return false;
}
- ExecutableElement executableElement = element2 as ExecutableElement;
+ ExecutableElement executableElement = element as ExecutableElement;
if (executableElement.isStatic()) {
return false;
}
- Element enclosingElement2 = element2.enclosingElement;
- if (enclosingElement2 is! ClassElement) {
+ Element enclosingElement = element.enclosingElement;
+ if (enclosingElement is! ClassElement) {
return false;
}
- ASTNode parent2 = node.parent;
- if (parent2 is MethodInvocation) {
- MethodInvocation invocation = parent2 as MethodInvocation;
+ ASTNode parent = node.parent;
+ if (parent is MethodInvocation) {
+ MethodInvocation invocation = parent as MethodInvocation;
if (identical(invocation.methodName, node) && invocation.realTarget != null) {
return false;
}
}
{
- if (parent2 is PropertyAccess) {
- PropertyAccess access = parent2 as PropertyAccess;
+ if (parent is PropertyAccess) {
+ PropertyAccess access = parent as PropertyAccess;
if (identical(access.propertyName, node) && access.realTarget != null) {
return false;
}
}
- if (parent2 is PrefixedIdentifier) {
- PrefixedIdentifier prefixed = parent2 as PrefixedIdentifier;
+ if (parent is PrefixedIdentifier) {
+ PrefixedIdentifier prefixed = parent as PrefixedIdentifier;
if (identical(prefixed.identifier, node)) {
return false;
}
@@ -11461,15 +11461,15 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (nodeLibrary == null) {
return false;
}
- String name2 = nodeLibrary.name;
- LibraryElement prevLibrary = _nameToImportElement[name2];
+ String name = nodeLibrary.name;
+ LibraryElement prevLibrary = _nameToImportElement[name];
if (prevLibrary != null) {
if (prevLibrary != nodeLibrary) {
- _errorReporter.reportError2(StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAME, node, [prevLibrary.definingCompilationUnit.displayName, nodeLibrary.definingCompilationUnit.displayName, name2]);
+ _errorReporter.reportError2(StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAME, node, [prevLibrary.definingCompilationUnit.displayName, nodeLibrary.definingCompilationUnit.displayName, name]);
return true;
}
} else {
- _nameToImportElement[name2] = nodeLibrary;
+ _nameToImportElement[name] = nodeLibrary;
}
return false;
}
@@ -11485,14 +11485,14 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (_isInSystemLibrary) {
return false;
}
- Element element2 = node.element;
- if (element2 is! ImportElement) {
+ Element element = node.element;
+ if (element is! ImportElement) {
return false;
}
- ImportElement importElement = element2 as ImportElement;
+ ImportElement importElement = element as ImportElement;
DartSdk sdk = _currentLibrary.context.sourceFactory.dartSdk;
- String uri2 = importElement.uri;
- SdkLibrary sdkLibrary = sdk.getSdkLibrary(uri2);
+ String uri = importElement.uri;
+ SdkLibrary sdkLibrary = sdk.getSdkLibrary(uri);
if (sdkLibrary == null) {
return false;
}
@@ -11516,13 +11516,13 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
for (SwitchMember switchMember in switchMembers) {
if (switchMember is SwitchCase) {
SwitchCase switchCase = switchMember as SwitchCase;
- Expression expression2 = switchCase.expression;
+ Expression expression = switchCase.expression;
if (firstType == null) {
- firstType = getBestType(expression2);
+ firstType = getBestType(expression);
} else {
- Type2 nType = getBestType(expression2);
+ Type2 nType = getBestType(expression);
if (firstType != nType) {
- _errorReporter.reportError2(CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES, expression2, [expression2.toSource(), firstType.displayName]);
+ _errorReporter.reportError2(CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES, expression, [expression.toSource(), firstType.displayName]);
foundError = true;
}
}
@@ -11806,20 +11806,20 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (node.element != null) {
return false;
}
- ConstructorName constructorName2 = node.constructorName;
- if (constructorName2 == null) {
+ ConstructorName constructorName = node.constructorName;
+ if (constructorName == null) {
return false;
}
- TypeName type2 = constructorName2.type;
- if (type2 == null) {
+ TypeName type = constructorName.type;
+ if (type == null) {
return false;
}
- Identifier className = type2.name;
- SimpleIdentifier name2 = constructorName2.name;
- if (name2 != null) {
- _errorReporter.reportError2(StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, name2, [className, name2]);
+ Identifier className = type.name;
+ SimpleIdentifier name = constructorName.name;
+ if (name != null) {
+ _errorReporter.reportError2(StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, name, [className, name]);
} else {
- _errorReporter.reportError2(StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, constructorName2, [className]);
+ _errorReporter.reportError2(StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, constructorName, [className]);
}
return true;
}
@@ -11842,12 +11842,12 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
Set<ExecutableElement> missingOverrides = new Set<ExecutableElement>();
Set<String> methodsInEnclosingClass = new Set<String>();
Set<String> accessorsInEnclosingClass = new Set<String>();
- List<MethodElement> methods2 = _enclosingClass.methods;
- for (MethodElement method in methods2) {
+ List<MethodElement> methods = _enclosingClass.methods;
+ for (MethodElement method in methods) {
javaSetAdd(methodsInEnclosingClass, method.name);
}
- List<PropertyAccessorElement> accessors2 = _enclosingClass.accessors;
- for (PropertyAccessorElement accessor in accessors2) {
+ List<PropertyAccessorElement> accessors = _enclosingClass.accessors;
+ for (PropertyAccessorElement accessor in accessors) {
javaSetAdd(accessorsInEnclosingClass, accessor.name);
}
Map<String, ExecutableElement> membersInheritedFromSuperclasses = _inheritanceManager.getMapOfMembersInheritedFromClasses(_enclosingClass);
@@ -11999,14 +11999,14 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @see StaticWarningCode#NON_VOID_RETURN_FOR_OPERATOR
*/
bool checkForNonVoidReturnTypeForOperator(MethodDeclaration node) {
- SimpleIdentifier name2 = node.name;
- if (name2.name != "[]=") {
+ SimpleIdentifier name = node.name;
+ if (name.name != "[]=") {
return false;
}
TypeName typeName = node.returnType;
if (typeName != null) {
- Type2 type2 = typeName.type;
- if (type2 != null && !type2.isVoid()) {
+ Type2 type = typeName.type;
+ if (type != null && !type.isVoid()) {
_errorReporter.reportError2(StaticWarningCode.NON_VOID_RETURN_FOR_OPERATOR, typeName, []);
}
}
@@ -12021,8 +12021,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
*/
bool checkForNonVoidReturnTypeForSetter(TypeName typeName) {
if (typeName != null) {
- Type2 type2 = typeName.type;
- if (type2 != null && !type2.isVoid()) {
+ Type2 type = typeName.type;
+ if (type != null && !type.isVoid()) {
_errorReporter.reportError2(StaticWarningCode.NON_VOID_RETURN_FOR_SETTER, typeName, []);
}
}
@@ -12061,10 +12061,10 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @see CompileTimeErrorCode#PRIVATE_OPTIONAL_PARAMETER
*/
bool checkForPrivateOptionalParameter(DefaultFormalParameter node) {
- sc.Token separator2 = node.separator;
- if (separator2 != null && separator2.lexeme == ":") {
- NormalFormalParameter parameter2 = node.parameter;
- SimpleIdentifier name = parameter2.identifier;
+ sc.Token separator = node.separator;
+ if (separator != null && separator.lexeme == ":") {
+ NormalFormalParameter parameter = node.parameter;
+ SimpleIdentifier name = parameter.identifier;
if (!name.isSynthetic() && name.name.startsWith("_")) {
_errorReporter.reportError2(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, node, []);
return true;
@@ -12086,8 +12086,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
}
for (ConstructorInitializer initializer in node.initializers) {
if (initializer is RedirectingConstructorInvocation) {
- ConstructorElement element2 = node.element;
- if (!hasRedirectingFactoryConstructorCycle(element2)) {
+ ConstructorElement element = node.element;
+ if (!hasRedirectingFactoryConstructorCycle(element)) {
return false;
}
_errorReporter.reportError2(CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, initializer, []);
@@ -12109,8 +12109,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (redirectedConstructorNode == null) {
return false;
}
- ConstructorElement element2 = node.element;
- if (!hasRedirectingFactoryConstructorCycle(element2)) {
+ ConstructorElement element = node.element;
+ if (!hasRedirectingFactoryConstructorCycle(element)) {
return false;
}
_errorReporter.reportError2(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, redirectedConstructorNode, []);
@@ -12130,7 +12130,7 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (classElt == null) {
return false;
}
- InterfaceType supertype2 = classElt.supertype;
+ InterfaceType supertype = classElt.supertype;
list.add(classElt);
if (list.length != 1 && _enclosingClass == classElt) {
String enclosingClassName = _enclosingClass.displayName;
@@ -12147,7 +12147,7 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
_errorReporter.reportError3(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, _enclosingClass.nameOffset, enclosingClassName.length, [enclosingClassName, builder.toString()]);
return true;
} else if (list.length == 2) {
- ErrorCode errorCode = supertype2 != null && _enclosingClass == supertype2.element ? CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS : CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS;
+ ErrorCode errorCode = supertype != null && _enclosingClass == supertype.element ? CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS : CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS;
_errorReporter.reportError3(errorCode, _enclosingClass.nameOffset, enclosingClassName.length, [enclosingClassName]);
return true;
}
@@ -12160,9 +12160,9 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
}
List<ClassElement> interfaceElements;
List<InterfaceType> interfaceTypes = classElt.interfaces;
- if (supertype2 != null && !supertype2.isObject()) {
+ if (supertype != null && !supertype.isObject()) {
interfaceElements = new List<ClassElement>(interfaceTypes.length + 1);
- interfaceElements[0] = supertype2.element;
+ interfaceElements[0] = supertype.element;
for (int i = 0; i < interfaceTypes.length; i++) {
interfaceElements[i + 1] = interfaceTypes[i].element;
}
@@ -12229,18 +12229,18 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (redirectedConstructorNode == null) {
return false;
}
- ConstructorElement element2 = node.element;
- if (element2 == null) {
+ ConstructorElement element = node.element;
+ if (element == null) {
return false;
}
- if (!element2.isConst()) {
+ if (!element.isConst()) {
return false;
}
- ConstructorElement redirectedConstructor2 = element2.redirectedConstructor;
- if (redirectedConstructor2 == null) {
+ ConstructorElement redirectedConstructor = element.redirectedConstructor;
+ if (redirectedConstructor == null) {
return false;
}
- if (redirectedConstructor2.isConst()) {
+ if (redirectedConstructor.isConst()) {
return false;
}
_errorReporter.reportError2(CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR, redirectedConstructorNode, []);
@@ -12255,42 +12255,42 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @see CompileTimeErrorCode#REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER
*/
bool checkForReferenceToDeclaredVariableInInitializer(SimpleIdentifier node) {
- ASTNode parent2 = node.parent;
- if (parent2 is PrefixedIdentifier) {
- PrefixedIdentifier prefixedIdentifier = parent2 as PrefixedIdentifier;
+ ASTNode parent = node.parent;
+ if (parent is PrefixedIdentifier) {
+ PrefixedIdentifier prefixedIdentifier = parent as PrefixedIdentifier;
if (identical(prefixedIdentifier.identifier, node)) {
return false;
}
}
- if (parent2 is PropertyAccess) {
- PropertyAccess propertyAccess = parent2 as PropertyAccess;
+ if (parent is PropertyAccess) {
+ PropertyAccess propertyAccess = parent as PropertyAccess;
if (identical(propertyAccess.propertyName, node)) {
return false;
}
}
- if (parent2 is MethodInvocation) {
- MethodInvocation methodInvocation = parent2 as MethodInvocation;
+ if (parent is MethodInvocation) {
+ MethodInvocation methodInvocation = parent as MethodInvocation;
if (methodInvocation.target != null && identical(methodInvocation.methodName, node)) {
return false;
}
}
- if (parent2 is ConstructorName) {
- ConstructorName constructorName = parent2 as ConstructorName;
+ if (parent is ConstructorName) {
+ ConstructorName constructorName = parent as ConstructorName;
if (identical(constructorName.name, node)) {
return false;
}
}
- if (parent2 is Label) {
- Label label = parent2 as Label;
+ if (parent is Label) {
+ Label label = parent as Label;
if (identical(label.label, node)) {
return false;
}
}
- String name2 = node.name;
- if (!_namesForReferenceToDeclaredVariableInInitializer.contains(name2)) {
+ String name = node.name;
+ if (!_namesForReferenceToDeclaredVariableInInitializer.contains(name)) {
return false;
}
- _errorReporter.reportError2(CompileTimeErrorCode.REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER, node, [name2]);
+ _errorReporter.reportError2(CompileTimeErrorCode.REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER, node, [name]);
return true;
}
@@ -12317,11 +12317,11 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @see StaticWarningCode#STATIC_ACCESS_TO_INSTANCE_MEMBER
*/
bool checkForStaticAccessToInstanceMember(Expression target, SimpleIdentifier name2) {
- Element element2 = name2.element;
- if (element2 is! ExecutableElement) {
+ Element element = name2.element;
+ if (element is! ExecutableElement) {
return false;
}
- ExecutableElement memberElement = element2 as ExecutableElement;
+ ExecutableElement memberElement = element as ExecutableElement;
if (memberElement.isStatic()) {
return false;
}
@@ -12340,13 +12340,13 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @see StaticWarningCode#SWITCH_EXPRESSION_NOT_ASSIGNABLE
*/
bool checkForSwitchExpressionNotAssignable(SwitchStatement node) {
- Expression expression2 = node.expression;
- Type2 expressionType = getStaticType(expression2);
+ Expression expression = node.expression;
+ Type2 expressionType = getStaticType(expression);
if (expressionType == null) {
return false;
}
- NodeList<SwitchMember> members2 = node.members;
- for (SwitchMember switchMember in members2) {
+ NodeList<SwitchMember> members = node.members;
+ for (SwitchMember switchMember in members) {
if (switchMember is! SwitchCase) {
continue;
}
@@ -12356,7 +12356,7 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (expressionType.isAssignableTo(caseType)) {
return false;
}
- _errorReporter.reportError2(StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE, expression2, [expressionType, caseType]);
+ _errorReporter.reportError2(StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE, expression, [expressionType, caseType]);
return true;
}
return false;
@@ -12449,20 +12449,20 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (nameNode == null) {
return false;
}
- String name2 = nameNode.name;
+ String name = nameNode.name;
int expected = -1;
- if ("[]=" == name2) {
+ if ("[]=" == name) {
expected = 2;
- } else if ("<" == name2 || ">" == name2 || "<=" == name2 || ">=" == name2 || "==" == name2 || "+" == name2 || "/" == name2 || "~/" == name2 || "*" == name2 || "%" == name2 || "|" == name2 || "^" == name2 || "&" == name2 || "<<" == name2 || ">>" == name2 || "[]" == name2) {
+ } else if ("<" == name || ">" == name || "<=" == name || ">=" == name || "==" == name || "+" == name || "/" == name || "~/" == name || "*" == name || "%" == name || "|" == name || "^" == name || "&" == name || "<<" == name || ">>" == name || "[]" == name) {
expected = 1;
- } else if ("~" == name2) {
+ } else if ("~" == name) {
expected = 0;
}
if (expected != -1 && numParameters != expected) {
- _errorReporter.reportError2(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, nameNode, [name2, expected, numParameters]);
+ _errorReporter.reportError2(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, nameNode, [name, expected, numParameters]);
return true;
}
- if ("-" == name2 && numParameters > 1) {
+ if ("-" == name && numParameters > 1) {
_errorReporter.reportError2(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS, nameNode, [numParameters]);
return true;
}
@@ -12562,9 +12562,9 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
*/
VariableElement getVariableElement(Expression expression) {
if (expression is Identifier) {
- Element element2 = ((expression as Identifier)).element;
- if (element2 is VariableElement) {
- return element2 as VariableElement;
+ Element element = ((expression as Identifier)).element;
+ if (element is VariableElement) {
+ return element as VariableElement;
}
}
return null;
@@ -12715,13 +12715,13 @@ class PubVerifier extends RecursiveASTVisitor<Object> {
String getSourceFullName(ASTNode node) {
CompilationUnit unit = node.getAncestor(CompilationUnit);
if (unit != null) {
- CompilationUnitElement element2 = unit.element;
- if (element2 != null) {
- Source librarySource = element2.source;
+ CompilationUnitElement element = unit.element;
+ if (element != null) {
+ Source librarySource = element.source;
if (librarySource != null) {
- String fullName2 = librarySource.fullName;
- if (fullName2 != null) {
- return fullName2.replaceAll(r'\', '/');
+ String fullName = librarySource.fullName;
+ if (fullName != null) {
+ return fullName.replaceAll(r'\', '/');
}
}
}
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/parser.dart ('k') | pkg/analyzer_experimental/lib/src/generated/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698