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