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

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

Issue 2288223003: Don't perform final fields and top-level variables type propagation. (Closed)
Patch Set: Rewrite 'reuse' tests using 'inferredTypeSlot'. Created 4 years, 4 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/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 9d04dff3d942338de40855dede9712fbb063f200..d0542224a7e3e5d74e24b397d2d8d4f41398cbb0 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -5202,12 +5202,6 @@ class PartialResolverVisitor extends ResolverVisitor {
final List<VariableElement> staticVariables = <VariableElement>[];
/**
- * The static and instance variables and fields that have an initializer.
- * These are the variables whose types might be propagated.
- */
- final List<VariableElement> propagableVariables = <VariableElement>[];
-
- /**
* Initialize a newly created visitor to resolve the nodes in an AST node.
*
* The [definingLibrary] is the element for the library containing the node
@@ -5248,7 +5242,6 @@ class PartialResolverVisitor extends ResolverVisitor {
@override
Object visitFieldDeclaration(FieldDeclaration node) {
- _addPropagableVariables(node.fields.variables);
if (node.isStatic) {
_addStaticVariables(node.fields.variables);
}
@@ -5262,28 +5255,11 @@ class PartialResolverVisitor extends ResolverVisitor {
@override
Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
- _addPropagableVariables(node.variables.variables);
_addStaticVariables(node.variables.variables);
return super.visitTopLevelVariableDeclaration(node);
}
/**
- * Add all of the [variables] with initializers to [propagableVariables].
- */
- void _addPropagableVariables(List<VariableDeclaration> variables) {
- int length = variables.length;
- for (int i = 0; i < length; i++) {
- VariableDeclaration variable = variables[i];
- if (variable.name.name.isNotEmpty && variable.initializer != null) {
- VariableElement element = variable.element;
- if (element.isConst || element.isFinal) {
- propagableVariables.add(element);
- }
- }
- }
- }
-
- /**
* Add all of the [variables] with initializers to the list of variables whose
* type can be inferred. Technically, we only infer the types of variables
* that do not have a static type, but all variables with initializers
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolver.dart ('k') | pkg/analyzer/lib/src/plugin/engine_plugin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698