| 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 da79930df9a411e83763e1be010e622f8f932ecd..e83082b54c262d65ca6da4146e584a5c5ddba81d 100644
|
| --- a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
|
| +++ b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
|
| @@ -594,7 +594,7 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl
|
| }
|
| // maybe ends with "return" statement
|
| if (_selectionStatements != null) {
|
| - _ReturnTypeComputer returnTypeComputer = new _ReturnTypeComputer();
|
| + _ReturnTypeComputer returnTypeComputer = new _ReturnTypeComputer(context);
|
| _selectionStatements.forEach((statement) {
|
| statement.accept(returnTypeComputer);
|
| });
|
| @@ -1158,8 +1158,12 @@ class _Occurrence {
|
| }
|
|
|
| class _ReturnTypeComputer extends RecursiveAstVisitor {
|
| + final AnalysisContext context;
|
| +
|
| DartType returnType;
|
|
|
| + _ReturnTypeComputer(this.context);
|
| +
|
| @override
|
| visitBlockFunctionBody(BlockFunctionBody node) {}
|
|
|
| @@ -1182,7 +1186,8 @@ class _ReturnTypeComputer extends RecursiveAstVisitor {
|
| if (returnType is InterfaceType && type is InterfaceType) {
|
| returnType = InterfaceType.getSmartLeastUpperBound(returnType, type);
|
| } else {
|
| - returnType = returnType.getLeastUpperBound(type);
|
| + returnType = context.typeSystem
|
| + .getLeastUpperBound(context.typeProvider, returnType, type);
|
| }
|
| }
|
| }
|
|
|