| Index: lib/compiler/implementation/dart_backend/backend.dart
|
| diff --git a/lib/compiler/implementation/dart_backend/backend.dart b/lib/compiler/implementation/dart_backend/backend.dart
|
| index aa5cb2c705efbc567f457035a33ae811387803c1..e4adcc3786cc0a9a2228cfa841561f44a1ff41bc 100644
|
| --- a/lib/compiler/implementation/dart_backend/backend.dart
|
| +++ b/lib/compiler/implementation/dart_backend/backend.dart
|
| @@ -69,6 +69,10 @@ class DartBackend extends Backend {
|
| compiler, element, treeElements, typedefs, classes)
|
| .collect();
|
| });
|
| + final emptyTreeElements = new TreeElementMapping();
|
| + collectElement(element) { collector.collect(element, emptyTreeElements); }
|
| + typedefs.forEach(collectElement);
|
| + classes.forEach(collectElement);
|
|
|
| ConflictingRenamer renamer =
|
| new ConflictingRenamer(compiler, collector.placeholders);
|
| @@ -142,7 +146,12 @@ class ReferencedElementCollector extends AbstractVisitor {
|
| visitTypeAnnotation(TypeAnnotation typeAnnotation) {
|
| final type = compiler.resolveTypeAnnotation(element, typeAnnotation);
|
| Element typeElement = type.element;
|
| - if (typeElement.isTypedef()) typedefs.add(typeElement);
|
| + if (typeElement.isTypedef() && !typedefs.contains(typeElement)) {
|
| + typedefs.add(typeElement);
|
| + new ReferencedElementCollector(
|
| + compiler, typeElement, new TreeElementMapping(), typedefs, classes)
|
| + .collect();
|
| + }
|
| if (typeElement.isClass()) classes.add(typeElement);
|
| typeAnnotation.visitChildren(this);
|
| }
|
|
|