Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_types.dart

Issue 13261008: Check for cyclic reference in typedefs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698