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

Unified Diff: pkg/analyzer/lib/src/generated/static_type_analyzer.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
Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index fa2bf1c4027e2e106f94caff586670f73d5e0ead..d4d0d494d22810c60abadb1ca660be1dda6404df 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -1535,14 +1535,11 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
// TODO(vsm): Use leafp's matchType here?
DartType _findIteratedType(DartType type, DartType targetType) {
// Set by _find if match is found
- DartType result = null;
+ DartType result;
// Elements we've already visited on a given inheritance path.
- HashSet<ClassElement> visitedClasses = null;
+ HashSet<ClassElement> visitedClasses;
- while (type is TypeParameterType) {
- TypeParameterElement element = type.element;
- type = element.bound;
- }
+ type = type.resolveToBound(_typeProvider.objectType);
bool _find(InterfaceType type) {
ClassElement element = type.element;
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | pkg/analyzer/lib/src/generated/type_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698