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

Unified Diff: pkg/analyzer/lib/dart/element/type.dart

Issue 1686893002: Consolidate the code that replaces a TypeParameter with its bound. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add unit tests. Created 4 years, 10 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/element/type.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/dart/element/type.dart
diff --git a/pkg/analyzer/lib/dart/element/type.dart b/pkg/analyzer/lib/dart/element/type.dart
index f49c170544e92ea42e4bd5d74696a588f9ac9531..3ff2ce83b166c11deb006c93d0a2f6897bfc3b5d 100644
--- a/pkg/analyzer/lib/dart/element/type.dart
+++ b/pkg/analyzer/lib/dart/element/type.dart
@@ -150,6 +150,15 @@ abstract class DartType {
*/
DartType substitute2(
List<DartType> argumentTypes, List<DartType> parameterTypes);
+
+ /**
+ * If this type is a [TypeParameterType], returns its bound if it has one, or
+ * [objectType] otherwise.
+ *
+ * For any other type, returns `this`. Applies recursively -- if the bound is
+ * itself a type parameter, that is resolved too.
+ */
+ DartType resolveToBound(DartType objectType);
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/element/type.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698