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

Unified Diff: pkg/analyzer/lib/src/dart/element/builder.dart

Issue 2422333002: Remove _functionTypesToFix from ElementBuilder. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/element/builder.dart
diff --git a/pkg/analyzer/lib/src/dart/element/builder.dart b/pkg/analyzer/lib/src/dart/element/builder.dart
index 7e06a56497098689ed756cbcebe52ee6e1bc0606..85a1ff6eab5e7ab3778c44d6677e4c0f96f51f9d 100644
--- a/pkg/analyzer/lib/src/dart/element/builder.dart
+++ b/pkg/analyzer/lib/src/dart/element/builder.dart
@@ -327,14 +327,6 @@ class ElementBuilder extends RecursiveAstVisitor<Object> {
bool _inFunction = false;
/**
- * A collection holding the elements defined in a class that need to have
- * their function type fixed to take into account type parameters of the
- * enclosing class, or `null` if we are not currently processing nodes within
- * a class.
- */
- List<ExecutableElementImpl> _functionTypesToFix = null;
-
- /**
* A table mapping field names to field elements for the fields defined in the current class, or
* `null` if we are not in the scope of a class.
*/
@@ -404,7 +396,6 @@ class ElementBuilder extends RecursiveAstVisitor<Object> {
@override
Object visitClassDeclaration(ClassDeclaration node) {
ElementHolder holder = new ElementHolder();
- _functionTypesToFix = new List<ExecutableElementImpl>();
//
// Process field declarations before constructors and methods so that field
// formal parameters can be correctly resolved to their fields.
@@ -438,12 +429,6 @@ class ElementBuilder extends RecursiveAstVisitor<Object> {
element.constructors = constructors;
element.fields = holder.fields;
element.methods = holder.methods;
- // Function types must be initialized after the enclosing element has been
- // set, for them to pick up the type parameters.
- for (ExecutableElementImpl e in _functionTypesToFix) {
- e.type = new FunctionTypeImpl(e);
- }
- _functionTypesToFix = null;
_currentHolder.addType(element);
className.staticElement = element;
_fieldMap = null;
@@ -835,11 +820,7 @@ class ElementBuilder extends RecursiveAstVisitor<Object> {
element.setVisibleRange(enclosingBlock.offset, enclosingBlock.length);
}
}
- if (_functionTypesToFix != null) {
- _functionTypesToFix.add(element);
- } else {
- element.type = new FunctionTypeImpl(element);
- }
+ element.type = new FunctionTypeImpl(element);
element.hasImplicitReturnType = true;
_currentHolder.addFunction(element);
node.element = element;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698