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; |
} |