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

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

Issue 25373002: Issue 13584. Fix for Java/Dart local variable scoping mismatch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 53f57701f052dc31506bc344f31110f3e1cd404f..535ce2e92ae315d2e51362d3cf37f6273c71dd6c 100644
--- a/pkg/analyzer_experimental/lib/src/generated/resolver.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/resolver.dart
@@ -33,7 +33,7 @@ class CompilationUnitBuilder {
* @return the compilation unit element that was built
* @throws AnalysisException if the analysis could not be performed
*/
- CompilationUnitElementImpl buildCompilationUnit(Source source2, CompilationUnit unit) {
+ CompilationUnitElementImpl buildCompilationUnit(Source source, CompilationUnit unit) {
TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
if (unit == null) {
return null;
@@ -41,10 +41,10 @@ class CompilationUnitBuilder {
ElementHolder holder = new ElementHolder();
ElementBuilder builder = new ElementBuilder(holder);
unit.accept(builder);
- CompilationUnitElementImpl element = new CompilationUnitElementImpl(source2.shortName);
+ CompilationUnitElementImpl element = new CompilationUnitElementImpl(source.shortName);
element.accessors = holder.accessors;
element.functions = holder.functions;
- element.source = source2;
+ element.source = source;
element.typeAliases = holder.typeAliases;
element.types = holder.types;
element.topLevelVariables = holder.topLevelVariables;
@@ -693,7 +693,7 @@ class ElementBuilder extends RecursiveASTVisitor<Object> {
* @param keyword the keyword being tested for
* @return `true` if the given token is a token for the given keyword
*/
- bool matches(sc.Token token, sc.Keyword keyword2) => token != null && identical(token.type, sc.TokenType.KEYWORD) && identical(((token as sc.KeywordToken)).keyword, keyword2);
+ bool matches(sc.Token token, sc.Keyword keyword) => token != null && identical(token.type, sc.TokenType.KEYWORD) && identical(((token as sc.KeywordToken)).keyword, keyword);
/**
* Sets the visible source range for formal parameter.
@@ -1117,11 +1117,11 @@ class HtmlUnitBuilder implements ht.XmlVisitor<Object> {
* @param unit the AST structure representing the HTML
* @throws AnalysisException if the analysis could not be performed
*/
- HtmlElementImpl buildHtmlElement2(Source source2, int modificationStamp2, ht.HtmlUnit unit) {
- this._modificationStamp = modificationStamp2;
- _lineInfo = _context.computeLineInfo(source2);
- HtmlElementImpl result = new HtmlElementImpl(_context, source2.shortName);
- result.source = source2;
+ HtmlElementImpl buildHtmlElement2(Source source, int modificationStamp, ht.HtmlUnit unit) {
+ this._modificationStamp = modificationStamp;
+ _lineInfo = _context.computeLineInfo(source);
+ HtmlElementImpl result = new HtmlElementImpl(_context, source.shortName);
+ result.source = source;
_htmlElement = result;
unit.accept(this);
_htmlElement = null;
@@ -1296,7 +1296,6 @@ class BestPracticesVerifier extends RecursiveASTVisitor<Object> {
static String _HASHCODE_GETTER_NAME = "hashCode";
static String _METHOD = "method";
static String _NULL_TYPE_NAME = "Null";
- static String _OBJECT_TYPE_NAME = "Object";
static String _SETTER = "setter";
static String _TO_INT_METHOD_NAME = "toInt";
@@ -1394,7 +1393,7 @@ class BestPracticesVerifier extends RecursiveASTVisitor<Object> {
Element rhsElement = rhsType.element;
LibraryElement libraryElement = rhsElement != null ? rhsElement.library : null;
if (libraryElement != null && libraryElement.isDartCore) {
- if ((rhsType.isObject && rhsNameStr == _OBJECT_TYPE_NAME) || (expression is NullLiteral && rhsNameStr == _NULL_TYPE_NAME)) {
+ if (rhsType.isObject || (expression is NullLiteral && rhsNameStr == _NULL_TYPE_NAME)) {
if (node.notOperator == null) {
_errorReporter.reportError2(HintCode.UNNECESSARY_TYPE_CHECK_TRUE, node, []);
} else {
@@ -2077,8 +2076,8 @@ class ImportsVerifier extends RecursiveASTVisitor<Object> {
return visitIdentifier(element, prefixIdentifier.name);
}
Object visitSimpleIdentifier(SimpleIdentifier node) => visitIdentifier(node.staticElement, node.name);
- void set inDefiningCompilationUnit(bool inDefiningCompilationUnit2) {
- this._inDefiningCompilationUnit = inDefiningCompilationUnit2;
+ void set inDefiningCompilationUnit(bool inDefiningCompilationUnit) {
+ this._inDefiningCompilationUnit = inDefiningCompilationUnit;
}
/**
@@ -2377,9 +2376,9 @@ class DeclarationResolver extends RecursiveASTVisitor<Object> {
* @param unit the compilation unit to be resolved
* @param element the root of the element model used to resolve the AST nodes
*/
- void resolve(CompilationUnit unit, CompilationUnitElement element2) {
- _enclosingUnit = element2;
- unit.element = element2;
+ void resolve(CompilationUnit unit, CompilationUnitElement element) {
+ _enclosingUnit = element;
+ unit.element = element;
unit.accept(this);
}
Object visitCatchClause(CatchClause node) {
@@ -2737,9 +2736,9 @@ class DeclarationResolver extends RecursiveASTVisitor<Object> {
* for
* @return the export element whose library has the given source
*/
- ExportElement find5(List<ExportElement> exports, Source source2) {
+ ExportElement find5(List<ExportElement> exports, Source source) {
for (ExportElement export in exports) {
- if (export.exportedLibrary.source == source2) {
+ if (export.exportedLibrary.source == source) {
return export;
}
}
@@ -2756,16 +2755,16 @@ class DeclarationResolver extends RecursiveASTVisitor<Object> {
* @param prefix the prefix with which the library was imported
* @return the import element whose library has the given source and prefix
*/
- ImportElement find6(List<ImportElement> imports, Source source2, SimpleIdentifier prefix2) {
+ ImportElement find6(List<ImportElement> imports, Source source, SimpleIdentifier prefix) {
for (ImportElement element in imports) {
- if (element.importedLibrary.source == source2) {
+ if (element.importedLibrary.source == source) {
PrefixElement prefixElement = element.prefix;
- if (prefix2 == null) {
+ if (prefix == null) {
if (prefixElement == null) {
return element;
}
} else {
- if (prefixElement != null && prefix2.name == prefixElement.displayName) {
+ if (prefixElement != null && prefix.name == prefixElement.displayName) {
return element;
}
}
@@ -3746,9 +3745,9 @@ class ElementResolver extends SimpleASTVisitor<Object> {
* @param executableElement the element that will be invoked with the arguments
* @return the parameters that correspond to the arguments
*/
- List<ParameterElement> computeCorrespondingParameters(ArgumentList argumentList, Element element2) {
- if (element2 is PropertyAccessorElement) {
- FunctionType getterType = ((element2 as PropertyAccessorElement)).type;
+ List<ParameterElement> computeCorrespondingParameters(ArgumentList argumentList, Element element) {
+ if (element is PropertyAccessorElement) {
+ FunctionType getterType = ((element as PropertyAccessorElement)).type;
if (getterType != null) {
Type2 getterReturnType = getterType.returnType;
if (getterReturnType is InterfaceType) {
@@ -3763,10 +3762,10 @@ class ElementResolver extends SimpleASTVisitor<Object> {
}
}
}
- } else if (element2 is ExecutableElement) {
- return resolveArgumentsToParameters(false, argumentList, element2 as ExecutableElement);
- } else if (element2 is VariableElement) {
- VariableElement variable = element2 as VariableElement;
+ } else if (element is ExecutableElement) {
+ return resolveArgumentsToParameters(false, argumentList, element as ExecutableElement);
+ } else if (element is VariableElement) {
+ VariableElement variable = element as VariableElement;
Type2 type = variable.type;
if (type is FunctionType) {
FunctionType functionType = type as FunctionType;
@@ -4343,9 +4342,9 @@ class ElementResolver extends SimpleASTVisitor<Object> {
* @param nameNode the name of the invoked constructor, may be `null` if unnamed constructor
* or not a constructor invocation
*/
- void resolveAnnotationElement(Annotation annotation, Element element2, SimpleIdentifier nameNode) {
- if (element2 is PropertyAccessorElement) {
- PropertyAccessorElement accessorElement = element2 as PropertyAccessorElement;
+ void resolveAnnotationElement(Annotation annotation, Element element, SimpleIdentifier nameNode) {
+ if (element is PropertyAccessorElement) {
+ PropertyAccessorElement accessorElement = element as PropertyAccessorElement;
if (!accessorElement.isSynthetic) {
_resolver.reportError5(CompileTimeErrorCode.INVALID_ANNOTATION, annotation, []);
return;
@@ -4356,14 +4355,14 @@ class ElementResolver extends SimpleASTVisitor<Object> {
}
return;
}
- if (element2 is ClassElement) {
+ if (element is ClassElement) {
if (nameNode == null) {
nameNode = annotation.constructorName;
}
String name = nameNode != null ? nameNode.name : null;
ConstructorElement constructor;
{
- InterfaceType interfaceType = new InterfaceTypeImpl.con1(element2 as ClassElement);
+ InterfaceType interfaceType = new InterfaceTypeImpl.con1(element as ClassElement);
LibraryElement definingLibrary = _resolver.definingLibrary;
constructor = interfaceType.lookUpConstructor(name, definingLibrary);
}
@@ -4378,7 +4377,7 @@ class ElementResolver extends SimpleASTVisitor<Object> {
resolveAnnotationConstructorInvocationArguments(annotation, constructor);
return;
}
- if (element2 != null) {
+ if (element != null) {
_resolver.reportError5(CompileTimeErrorCode.INVALID_ANNOTATION, annotation, []);
}
}
@@ -4906,8 +4905,8 @@ class InheritanceManager {
*
* @param library the new library element
*/
- void set libraryElement(LibraryElement library2) {
- this._library = library2;
+ void set libraryElement(LibraryElement library) {
+ this._library = library;
}
/**
@@ -5534,8 +5533,8 @@ class Library {
*
* @param exportedLibraries the libraries that are exported by this library
*/
- void set exportedLibraries(List<Library> exportedLibraries2) {
- this.exports = exportedLibraries2;
+ void set exportedLibraries(List<Library> exportedLibraries) {
+ this.exports = exportedLibraries;
}
/**
@@ -5543,8 +5542,8 @@ class Library {
*
* @param importedLibraries the libraries that are imported into this library
*/
- void set importedLibraries(List<Library> importedLibraries2) {
- this.imports = importedLibraries2;
+ void set importedLibraries(List<Library> importedLibraries) {
+ this.imports = importedLibraries;
}
/**
@@ -5552,10 +5551,10 @@ class Library {
*
* @param libraryElement the library element representing this library
*/
- void set libraryElement(LibraryElementImpl libraryElement2) {
- this._libraryElement = libraryElement2;
+ void set libraryElement(LibraryElementImpl libraryElement) {
+ this._libraryElement = libraryElement;
if (_inheritanceManager != null) {
- _inheritanceManager.libraryElement = libraryElement2;
+ _inheritanceManager.libraryElement = libraryElement;
}
}
String toString() => librarySource.shortName;
@@ -6444,9 +6443,9 @@ class ProxyConditionalAnalysisError {
* @param element the class being tested
* @return `true` if the given element represents a class that has the proxy annotation
*/
- static bool classHasProxyAnnotation(Element element2) {
- if (element2 is ClassElement) {
- ClassElement classElement = element2 as ClassElement;
+ static bool classHasProxyAnnotation(Element element) {
+ if (element is ClassElement) {
+ ClassElement classElement = element as ClassElement;
List<ElementAnnotation> annotations = classElement.metadata;
for (ElementAnnotation annotation in annotations) {
Element elementAnnotation = annotation.element;
@@ -7207,11 +7206,11 @@ class ResolverVisitor extends ScopedVisitor {
* @param expression the expression being tested
* @return `true` if the given expression terminates abruptly
*/
- bool isAbruptTermination(Expression expression2) {
- while (expression2 is ParenthesizedExpression) {
- expression2 = ((expression2 as ParenthesizedExpression)).expression;
+ bool isAbruptTermination(Expression expression) {
+ while (expression is ParenthesizedExpression) {
+ expression = ((expression as ParenthesizedExpression)).expression;
}
- return expression2 is ThrowExpression || expression2 is RethrowExpression;
+ return expression is ThrowExpression || expression is RethrowExpression;
}
/**
@@ -7499,6 +7498,16 @@ abstract class ScopedVisitor extends GeneralizingASTVisitor<Object> {
}
return null;
}
+ Object visitFormalParameterList(FormalParameterList node) {
+ super.visitFormalParameterList(node);
+ if (nameScope is FunctionScope) {
+ ((nameScope as FunctionScope)).defineParameters();
+ }
+ if (nameScope is FunctionTypeScope) {
+ ((nameScope as FunctionTypeScope)).defineParameters();
+ }
+ return null;
+ }
Object visitForStatement(ForStatement node) {
Scope outerNameScope = nameScope;
LabelScope outerLabelScope = labelScope;
@@ -7908,8 +7917,8 @@ class StaticTypeAnalyzer extends SimpleASTVisitor<Object> {
*
* @param thisType the type representing the class containing the nodes being analyzed
*/
- void set thisType(InterfaceType thisType2) {
- this._thisType = thisType2;
+ void set thisType(InterfaceType thisType) {
+ this._thisType = thisType;
}
/**
@@ -10038,12 +10047,12 @@ class TypeResolverVisitor extends ScopedVisitor {
TypeArgumentList argumentList = node.typeArguments;
Element element = nameScope.lookup(typeName, definingLibrary);
if (element == null) {
- if (typeName.name == _dynamicType.name) {
- setElement(typeName, _dynamicType.element);
+ if (typeName.name == this._dynamicType.name) {
+ setElement(typeName, this._dynamicType.element);
if (argumentList != null) {
}
- typeName.staticType = _dynamicType;
- node.type = _dynamicType;
+ typeName.staticType = this._dynamicType;
+ node.type = this._dynamicType;
return null;
}
VoidTypeImpl voidType = VoidTypeImpl.instance;
@@ -10119,10 +10128,10 @@ class TypeResolverVisitor extends ScopedVisitor {
if (element is MultiplyDefinedElement) {
setElement(typeName, element);
} else {
- setElement(typeName, _dynamicType.element);
+ setElement(typeName, this._dynamicType.element);
}
- typeName.staticType = _dynamicType;
- node.type = _dynamicType;
+ typeName.staticType = this._dynamicType;
+ node.type = this._dynamicType;
return null;
}
Type2 type = null;
@@ -10164,9 +10173,9 @@ class TypeResolverVisitor extends ScopedVisitor {
reportError5(StaticWarningCode.NOT_A_TYPE, typeName, [typeName.name]);
}
}
- setElement(typeName, _dynamicType.element);
- typeName.staticType = _dynamicType;
- node.type = _dynamicType;
+ setElement(typeName, this._dynamicType.element);
+ typeName.staticType = this._dynamicType;
+ node.type = this._dynamicType;
return null;
}
if (argumentList != null) {
@@ -10188,7 +10197,7 @@ class TypeResolverVisitor extends ScopedVisitor {
argumentCount = typeArguments.length;
if (argumentCount < parameterCount) {
for (int i = argumentCount; i < parameterCount; i++) {
- typeArguments.add(_dynamicType);
+ typeArguments.add(this._dynamicType);
}
}
if (type is InterfaceTypeImpl) {
@@ -10608,12 +10617,12 @@ class TypeResolverVisitor extends ScopedVisitor {
* @param returnType the (possibly `null`) return type of the function
* @param parameterList the list of parameters to the function
*/
- void setFunctionTypedParameterType(ParameterElementImpl element, TypeName returnType2, FormalParameterList parameterList) {
+ void setFunctionTypedParameterType(ParameterElementImpl element, TypeName returnType, FormalParameterList parameterList) {
List<ParameterElement> parameters = getElements(parameterList);
FunctionTypeAliasElementImpl aliasElement = new FunctionTypeAliasElementImpl(null);
aliasElement.synthetic = true;
aliasElement.shareParameters(parameters);
- aliasElement.returnType = computeReturnType(returnType2);
+ aliasElement.returnType = computeReturnType(returnType);
FunctionTypeImpl type = new FunctionTypeImpl.con2(aliasElement);
ClassElement definingClass = element.getAncestor(ClassElement);
if (definingClass != null) {
@@ -10750,6 +10759,8 @@ class EnclosedScope extends Scope {
* @coverage dart.engine.resolver
*/
class FunctionScope extends EnclosedScope {
+ ExecutableElement _functionElement;
+ bool _parametersDefined = false;
/**
* Initialize a newly created scope enclosed within another scope.
@@ -10758,23 +10769,25 @@ class FunctionScope extends EnclosedScope {
* @param functionElement the element representing the type represented by this scope
*/
FunctionScope(Scope enclosingScope, ExecutableElement functionElement) : super(new EnclosedScope(enclosingScope)) {
- defineParameters(functionElement);
+ this._functionElement = functionElement;
}
/**
* Define the parameters for the given function in the scope that encloses this function.
- *
- * @param functionElement the element representing the function represented by this scope
*/
- void defineParameters(ExecutableElement functionElement) {
+ void defineParameters() {
+ if (_parametersDefined) {
+ return;
+ }
+ _parametersDefined = true;
Scope parameterScope = enclosingScope;
- if (functionElement.enclosingElement is ExecutableElement) {
- String name = functionElement.name;
+ if (_functionElement.enclosingElement is ExecutableElement) {
+ String name = _functionElement.name;
if (name != null && !name.isEmpty) {
- parameterScope.define(functionElement);
+ parameterScope.define(_functionElement);
}
}
- for (ParameterElement parameter in functionElement.parameters) {
+ for (ParameterElement parameter in _functionElement.parameters) {
if (!parameter.isInitializingFormal) {
parameterScope.define(parameter);
}
@@ -10788,6 +10801,8 @@ class FunctionScope extends EnclosedScope {
* @coverage dart.engine.resolver
*/
class FunctionTypeScope extends EnclosedScope {
+ FunctionTypeAliasElement _typeElement;
+ bool _parametersDefined = false;
/**
* Initialize a newly created scope enclosed within another scope.
@@ -10796,8 +10811,8 @@ class FunctionTypeScope extends EnclosedScope {
* @param typeElement the element representing the type alias represented by this scope
*/
FunctionTypeScope(Scope enclosingScope, FunctionTypeAliasElement typeElement) : super(new EnclosedScope(enclosingScope)) {
- defineTypeParameters(typeElement);
- defineParameters(typeElement);
+ this._typeElement = typeElement;
+ defineTypeParameters();
}
/**
@@ -10805,8 +10820,12 @@ class FunctionTypeScope extends EnclosedScope {
*
* @param typeElement the element representing the type represented by this scope
*/
- void defineParameters(FunctionTypeAliasElement typeElement) {
- for (ParameterElement parameter in typeElement.parameters) {
+ void defineParameters() {
+ if (_parametersDefined) {
+ return;
+ }
+ _parametersDefined = true;
+ for (ParameterElement parameter in _typeElement.parameters) {
define(parameter);
}
}
@@ -10816,9 +10835,9 @@ class FunctionTypeScope extends EnclosedScope {
*
* @param typeElement the element representing the type represented by this scope
*/
- void defineTypeParameters(FunctionTypeAliasElement typeElement) {
+ void defineTypeParameters() {
Scope typeParameterScope = enclosingScope;
- for (TypeParameterElement typeParameter in typeElement.typeParameters) {
+ for (TypeParameterElement typeParameter in _typeElement.typeParameters) {
typeParameterScope.define(typeParameter);
}
}
@@ -10979,7 +10998,7 @@ class LibraryImportScope extends Scope {
if (enclosingLibrary != null) {
libName2 = enclosingLibrary.definingCompilationUnit.displayName;
}
- _errorListener.onError(new AnalysisError.con2(source2, identifier.offset, identifier.length, StaticWarningCode.AMBIGUOUS_IMPORT, [foundEltName, libName1, libName2]));
+ _errorListener.onError(new AnalysisError.con2(source, identifier.offset, identifier.length, StaticWarningCode.AMBIGUOUS_IMPORT, [foundEltName, libName1, libName2]));
return foundElement;
}
if (foundElement != null) {
@@ -11057,7 +11076,7 @@ class LibraryScope extends EnclosedScope {
offset = accessor.variable.nameOffset;
}
}
- return new AnalysisError.con2(source2, offset, duplicate.displayName.length, CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, [existing.displayName]);
+ return new AnalysisError.con2(source, offset, duplicate.displayName.length, CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, [existing.displayName]);
}
return super.getErrorForDuplicate(existing, duplicate);
}
@@ -11227,9 +11246,9 @@ class NamespaceBuilder {
* @param definedNames the mapping table to which the names in the given namespace are to be added
* @param namespace the namespace containing the names to be added to this namespace
*/
- void addAll2(Map<String, Element> definedNames2, Namespace namespace) {
+ void addAll2(Map<String, Element> definedNames, Namespace namespace) {
if (namespace != null) {
- addAll(definedNames2, namespace.definedNames);
+ addAll(definedNames, namespace.definedNames);
}
}
@@ -11477,7 +11496,7 @@ abstract class Scope {
AnalysisError getErrorForDuplicate(Element existing, Element duplicate) {
Source source = duplicate.source;
if (source == null) {
- source = source2;
+ source = this.source;
}
return new AnalysisError.con2(source, duplicate.nameOffset, duplicate.displayName.length, CompileTimeErrorCode.DUPLICATE_DEFINITION, [existing.displayName]);
}
@@ -11495,7 +11514,7 @@ abstract class Scope {
*
* @return the source object with which errors should be associated
*/
- Source get source2 => definingLibrary.definingCompilationUnit.source;
+ Source get source => definingLibrary.definingCompilationUnit.source;
/**
* Return the element with which the given name is associated, or `null` if the name is not
@@ -11700,14 +11719,14 @@ class ConstantVerifier extends RecursiveASTVisitor<Object> {
* @param result the result containing any errors that need to be reported
* @param errorCode the error code to be used if the result represents an error
*/
- void reportErrors(EvaluationResultImpl result, ErrorCode errorCode2) {
+ void reportErrors(EvaluationResultImpl result, ErrorCode errorCode) {
if (result is ErrorResult) {
for (ErrorResult_ErrorData data in ((result as ErrorResult)).errorData) {
ErrorCode dataErrorCode = data.errorCode;
if (identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION) || identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE) || identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING) || identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL) || identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_INT) || identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM)) {
_errorReporter.reportError2(dataErrorCode, data.node, []);
} else {
- _errorReporter.reportError2(errorCode2, data.node, []);
+ _errorReporter.reportError2(errorCode, data.node, []);
}
}
}
@@ -11764,11 +11783,11 @@ class ConstantVerifier extends RecursiveASTVisitor<Object> {
*
* @param parameters the list of parameters to be validated
*/
- void validateDefaultValues(FormalParameterList parameters2) {
- if (parameters2 == null) {
+ void validateDefaultValues(FormalParameterList parameters) {
+ if (parameters == null) {
return;
}
- for (FormalParameter parameter in parameters2.parameters) {
+ for (FormalParameter parameter in parameters.parameters) {
if (parameter is DefaultFormalParameter) {
DefaultFormalParameter defaultParameter = parameter as DefaultFormalParameter;
Expression defaultValue = defaultParameter.defaultValue;
@@ -12653,7 +12672,7 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @see StaticWarningCode#INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE
* @see StaticWarningCode#INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES
*/
- bool checkForAllInvalidOverrideErrorCodes(ExecutableElement executableElement, List<ParameterElement> parameters2, List<ASTNode> parameterLocations, SimpleIdentifier errorNameTarget) {
+ bool checkForAllInvalidOverrideErrorCodes(ExecutableElement executableElement, List<ParameterElement> parameters, List<ASTNode> parameterLocations, SimpleIdentifier errorNameTarget) {
String executableElementName = executableElement.name;
ExecutableElement overriddenExecutable = _inheritanceManager.lookupInheritance(_enclosingClass, executableElementName);
bool isGetter = false;
@@ -12773,8 +12792,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (!overriddenNamedPTEntry.getValue().isAssignableTo(overridingType)) {
ParameterElement parameterToSelect = null;
ASTNode parameterLocationToSelect = null;
- for (int i = 0; i < parameters2.length; i++) {
- ParameterElement parameter = parameters2[i];
+ for (int i = 0; i < parameters.length; i++) {
+ ParameterElement parameter = parameters[i];
if (identical(parameter.parameterKind, ParameterKind.NAMED) && overriddenNamedPTEntry.getKey() == parameter.name) {
parameterToSelect = parameter;
parameterLocationToSelect = parameterLocations[i];
@@ -12795,8 +12814,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
List<ParameterElementImpl> parameterElts = new List<ParameterElementImpl>();
List<ParameterElementImpl> overriddenParameterElts = new List<ParameterElementImpl>();
List<ParameterElement> overriddenPEs = overriddenExecutable.parameters;
- for (int i = 0; i < parameters2.length; i++) {
- ParameterElement parameter = parameters2[i];
+ for (int i = 0; i < parameters.length; i++) {
+ ParameterElement parameter = parameters[i];
if (parameter.parameterKind.isOptional) {
formalParameters.add(parameterLocations[i]);
parameterElts.add(parameter as ParameterElementImpl);
@@ -13348,11 +13367,11 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @return `true` if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS
*/
- bool checkForCaseExpressionTypeImplementsEquals(SwitchStatement node, Type2 type2) {
- if (type2 == null || type2 == _typeProvider.intType || type2 == _typeProvider.stringType) {
+ bool checkForCaseExpressionTypeImplementsEquals(SwitchStatement node, Type2 type) {
+ if (type == null || type == _typeProvider.intType || type == _typeProvider.stringType) {
return false;
}
- Element element = type2.element;
+ Element element = type.element;
if (element is! ClassElement) {
return false;
}
@@ -14356,14 +14375,14 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @return `true` if and only if an error code is generated on the passed node
* @see StaticTypeWarningCode#INSTANCE_ACCESS_TO_STATIC_MEMBER
*/
- bool checkForInstanceAccessToStaticMember(Expression target, SimpleIdentifier name2) {
+ bool checkForInstanceAccessToStaticMember(Expression target, SimpleIdentifier name) {
if (target == null) {
return false;
}
if (_isInComment) {
return false;
}
- Element element = name2.staticElement;
+ Element element = name.staticElement;
if (element is! ExecutableElement) {
return false;
}
@@ -14377,7 +14396,7 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (isTypeReference(target)) {
return false;
}
- _errorReporter.reportError2(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, name2, [name2.name]);
+ _errorReporter.reportError2(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, name, [name.name]);
return true;
}
@@ -15372,8 +15391,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @return `true` if and only if an error code is generated on the passed node
* @see StaticWarningCode#STATIC_ACCESS_TO_INSTANCE_MEMBER
*/
- bool checkForStaticAccessToInstanceMember(Expression target, SimpleIdentifier name2) {
- Element element = name2.staticElement;
+ bool checkForStaticAccessToInstanceMember(Expression target, SimpleIdentifier name) {
+ Element element = name.staticElement;
if (element is! ExecutableElement) {
return false;
}
@@ -15384,7 +15403,7 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (!isTypeReference(target)) {
return false;
}
- _errorReporter.reportError2(StaticWarningCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, name2, [name2.name]);
+ _errorReporter.reportError2(StaticWarningCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, name, [name.name]);
return true;
}
@@ -15573,8 +15592,8 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
* @return `true` if and only if an error code is generated on the passed node
* @see StaticTypeWarningCode#UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER
*/
- bool checkForUnqualifiedReferenceToNonLocalStaticMember(SimpleIdentifier name2) {
- Element element = name2.staticElement;
+ bool checkForUnqualifiedReferenceToNonLocalStaticMember(SimpleIdentifier name) {
+ Element element = name.staticElement;
if (element == null || element is TypeParameterElement) {
return false;
}
@@ -15588,7 +15607,7 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
if (identical(enclosingElement, _enclosingClass)) {
return false;
}
- _errorReporter.reportError2(StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, name2, [name2.name]);
+ _errorReporter.reportError2(StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, name, [name.name]);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698