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

Unified Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 2024453002: Resynthesize parameters lazily. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Extract ParameterElementImpl.resynthesizeList(). Created 4 years, 7 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
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index 4826d2c59cdca20e41d2f6f681827ddd246f99bc..09719ef08ac2ba3e43640670ff52651dea03e331 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -2094,19 +2094,6 @@ class _UnitResynthesizer {
executableElement.typeParameters =
buildTypeParameters(serializedExecutable.typeParameters);
{
- List<UnlinkedParam> unlinkedParameters = serializedExecutable.parameters;
- int length = unlinkedParameters.length;
- if (length != 0) {
- List<ParameterElementImpl> parameters =
- new List<ParameterElementImpl>(length);
- for (int i = 0; i < length; i++) {
- parameters[i] = new ParameterElementImpl.forSerializedFactory(
- unlinkedParameters[i], executableElement);
- }
- executableElement.parameters = parameters;
- }
- }
- {
List<UnlinkedExecutable> unlinkedFunctions =
serializedExecutable.localFunctions;
int length = unlinkedFunctions.length;
@@ -2272,18 +2259,8 @@ class _UnitResynthesizer {
return typeParameterContext.getTypeParameterType(type.paramReference);
} else if (type.syntheticReturnType != null) {
FunctionElementImpl element =
- new FunctionElementImpl_forLUB(unit, typeParameterContext);
- element.parameters = type.syntheticParams
- .map((UnlinkedParam param) =>
- new ParameterElementImpl.forSerializedFactory(param, element,
- synthetic: true))
- .toList();
- element.returnType =
- buildType(type.syntheticReturnType, typeParameterContext);
- FunctionTypeImpl result = new FunctionTypeImpl.elementWithNameAndArgs(
- element, null, null, false);
- element.type = result;
- return result;
+ new FunctionElementImpl_forLUB(unit, typeParameterContext, type);
+ return element.type;
} else {
DartType getTypeArgument(int i) {
if (i < type.typeArguments.length) {
@@ -2308,16 +2285,7 @@ class _UnitResynthesizer {
void buildTypedef(UnlinkedTypedef serializedTypedef) {
FunctionTypeAliasElementImpl functionTypeAliasElement =
new FunctionTypeAliasElementImpl.forSerialized(serializedTypedef, unit);
- // TODO(scheglov) remove this after delaying parameters and their types
- currentTypeParameters.add(functionTypeAliasElement.typeParameters);
- functionTypeAliasElement.parameters = serializedTypedef.parameters
- .map((p) => new ParameterElementImpl.forSerializedFactory(
- p, functionTypeAliasElement))
- .toList();
unitHolder.addTypeAlias(functionTypeAliasElement);
- // TODO(scheglov) remove this after delaying parameters and their types
- currentTypeParameters.removeLast();
- assert(currentTypeParameters.isEmpty);
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698