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

Unified Diff: pkg/analyzer/lib/src/generated/testing/element_factory.dart

Issue 2038153003: Create ClassElement.type lazily in ClassElementImpl and EnumElementImpl. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/testing/element_factory.dart
diff --git a/pkg/analyzer/lib/src/generated/testing/element_factory.dart b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
index ac293e74260cf4b8b77d4117f135a950a7c6dec5..106977c835d033c2079830d223ca0c2775dfa369 100644
--- a/pkg/analyzer/lib/src/generated/testing/element_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
@@ -47,16 +47,8 @@ class ElementFactory {
ClassElementImpl element = new ClassElementImpl(typeName, 0);
element.constructors = const <ConstructorElement>[];
element.supertype = superclassType;
- InterfaceTypeImpl type = new InterfaceTypeImpl(element);
- element.type = type;
if (parameterNames != null) {
- int count = parameterNames.length;
- if (count > 0) {
- element.typeParameters = typeParameters(parameterNames);
- type.typeArguments = new List<DartType>.from(
- element.typeParameters.map((p) => p.type),
- growable: false);
- }
+ element.typeParameters = typeParameters(parameterNames);
}
return element;
}
@@ -140,8 +132,7 @@ class ElementFactory {
// Build the enum.
//
EnumElementImpl enumElement = new EnumElementImpl(enumName, -1);
- InterfaceTypeImpl enumType = new InterfaceTypeImpl(enumElement);
- enumElement.type = enumType;
+ InterfaceTypeImpl enumType = enumElement.type;
//
// Populate the fields.
//
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698