Index: dart/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart |
=================================================================== |
--- dart/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart (revision 31659) |
+++ dart/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart (working copy) |
@@ -603,6 +603,15 @@ |
if (variables.head.element == variable) return index; |
} |
} |
+ |
+ /// Return all classes that are referenced in the type of the function, i.e., |
+ /// in the return type or the argument types. |
+ Set<ClassElement> getReferencedClasses(FunctionType type) { |
+ FunctionArgumentCollector collector = |
+ new FunctionArgumentCollector(backend); |
+ collector.collect(type); |
+ return collector.classes; |
+ } |
} |
class TypeRepresentationGenerator extends DartTypeVisitor { |