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

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

Issue 15299002: Reapply "Enable full type-checks in checked mode." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 6f76fe64a4428268717040a82b7c05940215522f..ecee2ba0a21f362a9597705684b6836750e0f523 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart
@@ -118,6 +118,8 @@ abstract class DartType {
*/
TypeVariableType get typeVariableOccurrence => null;
+ void forEachTypeVariable(f(TypeVariableType variable)) {}
+
TypeVariableType _findTypeVariableOccurrence(Link<DartType> types) {
for (Link<DartType> link = types; !link.isEmpty ; link = link.tail) {
TypeVariableType typeVariable = link.head.typeVariableOccurrence;
@@ -203,6 +205,10 @@ class TypeVariableType extends DartType {
DartType get typeVariableOccurrence => this;
+ void forEachTypeVariable(f(TypeVariableType variable)) {
+ f(this);
+ }
+
accept(DartTypeVisitor visitor, var argument) {
return visitor.visitTypeVariableType(this, argument);
}
@@ -407,6 +413,12 @@ abstract class GenericType extends DartType {
return _findTypeVariableOccurrence(typeArguments);
}
+ void forEachTypeVariable(f(TypeVariableType variable)) {
+ for (Link<DartType> link = typeArguments; !link.isEmpty; link = link.tail) {
+ link.head.forEachTypeVariable(f);
+ }
+ }
+
void visitChildren(DartTypeVisitor visitor, var argument) {
DartType.visitList(typeArguments, visitor, argument);
}

Powered by Google App Engine
This is Rietveld 408576698