Index: pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart |
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart |
index ee4166216ede6c53cb54d942acab19886ed6dfb4..54d61a4acb0d0c949a700bc56bb801bf929cbdf0 100644 |
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart |
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart |
@@ -39,8 +39,12 @@ class FieldNode extends dependencyWalker.Node<FieldNode> { |
final overrides = <Member>[]; |
+ final crossOverrides = <Member>[]; |
+ |
FieldNode(this._typeInferenceEngine, this.member); |
+ get candidateOverrides => overrides.isNotEmpty ? overrides : crossOverrides; |
+ |
@override |
bool get isEvaluated => state == FieldState.Inferred; |
@@ -158,10 +162,10 @@ abstract class TypeInferenceEngineImpl extends TypeInferenceEngine { |
List<FieldNode> computeFieldDependencies(FieldNode fieldNode) { |
// If the field's type is going to be determined by inheritance, then its |
// dependencies are determined by inheritance too. |
- if (fieldNode.overrides.isNotEmpty) { |
+ var candidateOverrides = fieldNode.candidateOverrides; |
+ if (candidateOverrides.isNotEmpty) { |
var dependencies = <FieldNode>[]; |
- for (var override in fieldNode.overrides) { |
- // TODO(paulberry): support dependencies on getters/setters too. |
+ for (var override in candidateOverrides) { |
var dep = KernelMember.getFieldNode(override); |
if (dep != null) dependencies.add(dep); |
} |
@@ -335,7 +339,7 @@ abstract class TypeInferenceEngineImpl extends TypeInferenceEngine { |
DartType tryInferFieldByInheritance(FieldNode fieldNode) { |
DartType inferredType; |
- for (var override in fieldNode.overrides) { |
+ for (var override in fieldNode.candidateOverrides) { |
var nextInferredType = _computeOverriddenFieldType(override, fieldNode); |
if (inferredType == null) { |
inferredType = nextInferredType; |