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

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

Issue 13133006: Check for cyclic type variable bounds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased + pull in PostProcess code. Created 7 years, 8 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..ce0cdfa9e188103f6fd208eafc282bcef89bbd05 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart
@@ -133,6 +133,15 @@ abstract class DartType {
bool get containsTypeVariables => typeVariableOccurrence != null;
accept(DartTypeVisitor visitor, var argument);
+
+ void visitChildren(DartTypeVisitor visitor, var argument) {}
+
+ static void visitList(Link<DartType> types,
+ DartTypeVisitor visitor, var argument) {
+ for (Link<DartType> link = types; !link.isEmpty ; link = link.tail) {
+ link.head.accept(visitor, argument);
+ }
+ }
}
/**
@@ -396,6 +405,10 @@ abstract class GenericType extends DartType {
return _findTypeVariableOccurrence(typeArguments);
}
+ void visitChildren(DartTypeVisitor visitor, var argument) {
+ DartType.visitList(typeArguments, visitor, argument);
+ }
+
String toString() {
StringBuffer sb = new StringBuffer();
sb.write(name.slowToString());
@@ -663,6 +676,13 @@ class FunctionType extends DartType {
return visitor.visitFunctionType(this, argument);
}
+ void visitChildren(DartTypeVisitor visitor, var argument) {
+ returnType.accept(visitor, argument);
+ DartType.visitList(parameterTypes, visitor, argument);
+ DartType.visitList(optionalParameterTypes, visitor, argument);
+ DartType.visitList(namedParameterTypes, visitor, argument);
+ }
+
String toString() {
StringBuffer sb = new StringBuffer();
sb.write('(');
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/compiler.dart ('k') | sdk/lib/_internal/compiler/implementation/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698