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

Unified Diff: pkg/analysis_server/lib/src/services/refactoring/extract_method.dart

Issue 730803003: Use a better way to compute InterfaceTypes least upper bound. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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/analysis_server/test/services/refactoring/extract_method_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
index 2673fef385dca2c2248a3b7076982a7fa7bcb434..40cad52155906b859cf90c9a53a674fd6d05c1cf 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
@@ -1113,7 +1113,11 @@ class _ReturnTypeComputer extends RecursiveAstVisitor {
if (returnType == null) {
returnType = type;
} else {
- returnType = returnType.getLeastUpperBound(type);
+ if (returnType is InterfaceType && type is InterfaceType) {
+ returnType = InterfaceType.getSmartLeastUpperBound(returnType, type);
+ } else {
+ returnType = returnType.getLeastUpperBound(type);
+ }
}
}
}
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/refactoring/extract_method_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698