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

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

Issue 837063002: Disable type propagation for class/top-level fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | pkg/analyzer/test/generated/incremental_resolver_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 d8106f6fb3ceae6d13e88064ac532c36451d7617..952323dd1197c80bce047e67d39dc7d70ba9e964 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -11433,14 +11433,18 @@ class ResolverVisitor extends ScopedVisitor {
allowPrecisionLoss ||
!currentType.isMoreSpecificThan(potentialType) ||
potentialType.isMoreSpecificThan(currentType)) {
- if (element is PropertyInducingElement) {
- PropertyInducingElement variable = element;
- if (!variable.isConst && !variable.isFinal) {
- return;
- }
- (variable as PropertyInducingElementImpl).propagatedType =
- potentialType;
- }
+ // TODO(scheglov) type propagation for instance/top-level fields
+ // was disabled because it depends on the order or visiting.
+ // If both field and its client are in the same unit, and we visit
+ // the client before the field, then propagated type is not set yet.
+// if (element is PropertyInducingElement) {
+// PropertyInducingElement variable = element;
+// if (!variable.isConst && !variable.isFinal) {
+// return;
+// }
+// (variable as PropertyInducingElementImpl).propagatedType =
+// potentialType;
+// }
_overrideManager.setType(element, potentialType);
}
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698