Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/dart_types.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/dart_types.dart b/sdk/lib/_internal/compiler/implementation/dart_types.dart |
| index 5f00a6239398959059aec7c69a12f529a4a0d9a7..fe390de8ec432ba87c93e099fb322483d179e2ee 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/dart_types.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart |
| @@ -894,6 +894,27 @@ abstract class DartTypeVisitor<R, A> { |
| visitInterfaceType(type, argument); |
| } |
| +abstract class DartTypeTraversal extends DartTypeVisitor { |
|
ahe
2013/04/02 08:22:39
As I understand it, there is one subclass of this
Johnni Winther
2013/04/02 09:40:14
Changed to use the visitChildren approach.
|
| + visit(DartType type) => type.accept(this, null); |
| + |
| + visitList(Link<DartType> types) { |
| + for (Link<DartType> link = types; !link.isEmpty; link = link.tail) { |
| + visit(link.head); |
| + } |
| + } |
| + |
| + visitFunctionType(FunctionType type, _) { |
| + visit(type.returnType); |
| + visitList(type.parameterTypes); |
| + visitList(type.optionalParameterTypes); |
| + visitList(type.namedParameterTypes); |
| + } |
| + |
| + visitGenericType(GenericType type, _) { |
| + visitList(type.typeArguments); |
| + } |
| +} |
| + |
| class SubtypeVisitor extends DartTypeVisitor<bool, DartType> { |
| final Compiler compiler; |
| final DynamicType dynamicType; |