Index: pkg/analysis_server/lib/src/services/refactoring/extract_local.dart |
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart |
index c865aec72eec276336d43c3be9b09ae729e72a28..b9510002c57f07a89c32b408974b643a6fd0ed09 100644 |
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart |
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart |
@@ -207,17 +207,15 @@ class ExtractLocalRefactoringImpl extends RefactoringImpl |
// fatal selection problems |
if (coveringExpressionOffsets.isEmpty) { |
if (node is SimpleIdentifier) { |
- Element element = node.bestElement; |
- if (element is FunctionElement || element is MethodElement) { |
- return new RefactoringStatus.fatal( |
- 'Cannot extract a single method name.', |
- newLocation_fromNode(node)); |
- } |
if (node.inDeclarationContext()) { |
return new RefactoringStatus.fatal( |
'Cannot extract the name part of a declaration.', |
newLocation_fromNode(node)); |
} |
+ Element element = node.bestElement; |
+ if (element is FunctionElement || element is MethodElement) { |
+ continue; |
+ } |
} |
if (parent is AssignmentExpression && parent.leftHandSide == node) { |
return new RefactoringStatus.fatal( |