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

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

Issue 1386033003: Issue 24503. Disable type overrides for properties. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | pkg/analyzer/test/generated/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 2fa00d49a6a2d8e86df19331d25d82f546acf799..a5a99af45a3b921807118aae0db3e91464dbd553 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -10529,6 +10529,14 @@ class ResolverVisitor extends ScopedVisitor {
*/
DartType overrideVariable(VariableElement element, DartType potentialType,
bool allowPrecisionLoss) {
+ // 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) {
+ return null;
+ }
+
if (potentialType == null || potentialType.isBottom) {
return null;
}
@@ -10561,18 +10569,6 @@ class ResolverVisitor extends ScopedVisitor {
allowPrecisionLoss ||
!currentType.isMoreSpecificThan(potentialType) ||
potentialType.isMoreSpecificThan(currentType)) {
- // 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);
return potentialType;
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698