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

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

Issue 2480783003: Avoid writing to the same parts of the element model in two tasks. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index b8852408b3a127cf59bd1e78db5f22cea633e301..9941049141386cdbbb4d1b27f14eaed72a4c6838 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -9529,7 +9529,7 @@ class TypeResolverVisitor extends ScopedVisitor {
_recordType(exception, exceptionType);
Element element = exception.staticElement;
if (element is VariableElementImpl) {
- element.type = exceptionType;
+ element.declaredType = exceptionType;
} else {
// TODO(brianwilkerson) Report the internal error
}
@@ -9539,7 +9539,7 @@ class TypeResolverVisitor extends ScopedVisitor {
_recordType(stackTrace, typeProvider.stackTraceType);
Element element = stackTrace.staticElement;
if (element is VariableElementImpl) {
- element.type = typeProvider.stackTraceType;
+ element.declaredType = typeProvider.stackTraceType;
} else {
// TODO(brianwilkerson) Report the internal error
}
@@ -9665,7 +9665,7 @@ class TypeResolverVisitor extends ScopedVisitor {
declaredType = _typeNameResolver._getType(typeName);
}
LocalVariableElementImpl element = node.element as LocalVariableElementImpl;
- element.type = declaredType;
+ element.declaredType = declaredType;
return null;
}
@@ -9688,7 +9688,7 @@ class TypeResolverVisitor extends ScopedVisitor {
} else {
type = _typeNameResolver._getType(typeName);
}
- element.type = type ?? _dynamicType;
+ element.declaredType = type ?? _dynamicType;
} else {
_setFunctionTypedParameterType(element, node.type, node.parameters);
}
@@ -9712,7 +9712,7 @@ class TypeResolverVisitor extends ScopedVisitor {
AnalysisEngine.instance.logger.logError(buffer.toString(),
new CaughtException(new AnalysisException(), null));
}
- element.returnType = _computeReturnType(node.returnType);
+ element.declaredReturnType = _computeReturnType(node.returnType);
element.type = new FunctionTypeImpl(element);
_inferSetterReturnType(element);
return null;
@@ -9761,7 +9761,7 @@ class TypeResolverVisitor extends ScopedVisitor {
AnalysisEngine.instance.logger.logError(buffer.toString(),
new CaughtException(new AnalysisException(), null));
}
- element.returnType = _computeReturnType(node.returnType);
+ element.declaredReturnType = _computeReturnType(node.returnType);
element.type = new FunctionTypeImpl(element);
_inferSetterReturnType(element);
if (element is PropertyAccessorElement) {
@@ -9769,11 +9769,11 @@ class TypeResolverVisitor extends ScopedVisitor {
PropertyInducingElementImpl variable =
accessor.variable as PropertyInducingElementImpl;
if (accessor.isGetter) {
- variable.type = element.returnType;
+ variable.declaredType = element.returnType;
} else if (variable.type == null) {
List<ParameterElement> parameters = element.parameters;
if (parameters != null && parameters.length > 0) {
- variable.type = parameters[0].type;
+ variable.declaredType = parameters[0].type;
}
}
}
@@ -9898,7 +9898,7 @@ class TypeResolverVisitor extends ScopedVisitor {
}
Element element = node.identifier.staticElement;
if (element is ParameterElementImpl) {
- element.type = declaredType;
+ element.declaredType = declaredType;
} else {
// TODO(brianwilkerson) Report the internal error.
}
@@ -9963,7 +9963,7 @@ class TypeResolverVisitor extends ScopedVisitor {
}
Element element = node.name.staticElement;
if (element is VariableElementImpl) {
- element.type = declaredType;
+ element.declaredType = declaredType;
}
return null;
}
@@ -10037,7 +10037,7 @@ class TypeResolverVisitor extends ScopedVisitor {
element is PropertyAccessorElementImpl &&
element.isSetter &&
element.hasImplicitReturnType) {
- element.returnType = VoidTypeImpl.instance;
+ element.declaredReturnType = VoidTypeImpl.instance;
}
}
@@ -10185,7 +10185,7 @@ class TypeResolverVisitor extends ScopedVisitor {
FunctionElementImpl functionElement = new FunctionElementImpl.forNode(null);
functionElement.synthetic = true;
functionElement.shareParameters(parameters);
- functionElement.returnType = _computeReturnType(returnType);
+ functionElement.declaredReturnType = _computeReturnType(returnType);
functionElement.enclosingElement = element;
functionElement.shareTypeParameters(element.typeParameters);
element.type = new FunctionTypeImpl(functionElement);
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698