Index: pkg/analyzer/lib/src/summary/link.dart |
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart |
index 6a87b7fa20182469c28e786f8fc8bc86d50c1aca..5c70e57bbd0209aa89ff7e4d43078d112ff10684 100644 |
--- a/pkg/analyzer/lib/src/summary/link.dart |
+++ b/pkg/analyzer/lib/src/summary/link.dart |
@@ -4797,13 +4797,13 @@ class TypeInferenceDependencyWalker |
extends DependencyWalker<TypeInferenceNode> { |
@override |
void evaluate(TypeInferenceNode v) { |
- v.evaluate(false); |
+ v.evaluate(null); |
} |
@override |
void evaluateScc(List<TypeInferenceNode> scc) { |
for (TypeInferenceNode v in scc) { |
- v.evaluate(true); |
+ v.evaluate(scc); |
} |
} |
} |
@@ -4922,10 +4922,24 @@ class TypeInferenceNode extends Node<TypeInferenceNode> { |
return dependencies; |
} |
- void evaluate(bool inCycle) { |
- if (inCycle) { |
+ void evaluate(List<TypeInferenceNode> cycle) { |
+ if (cycle != null) { |
+ List<String> cycleNames = cycle |
+ .map((node) { |
+ Element e = node.functionElement; |
+ while (e != null) { |
+ if (e is VariableElement) { |
+ return e.name; |
+ } |
+ e = e.enclosingElement; |
+ } |
+ return '<unknown>'; |
+ }) |
+ .toSet() |
+ .toList(); |
functionElement._setInferenceError(new TopLevelInferenceErrorBuilder( |
- kind: TopLevelInferenceErrorKind.dependencyCycle)); |
+ kind: TopLevelInferenceErrorKind.dependencyCycle, |
+ arguments: cycleNames)); |
functionElement._setInferredType(DynamicTypeImpl.instance); |
} else { |
var computer = new ExprTypeComputer(functionElement); |