| 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);
|
| }
|
|
|