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

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

Issue 970063002: When a closure is extracted as a method, it does not have any return type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library services.src.refactoring.extract_method; 5 library services.src.refactoring.extract_method;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol_server.dart' hide Element; 9 import 'package:analysis_server/src/protocol_server.dart' hide Element;
10 import 'package:analysis_server/src/services/correction/name_suggestion.dart'; 10 import 'package:analysis_server/src/services/correction/name_suggestion.dart';
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 result.addFatalError(format( 608 result.addFatalError(format(
609 'Ambiguous return value: Selected block contains more than one ' 609 'Ambiguous return value: Selected block contains more than one '
610 'assignment to local variables. Affected variables are:\n\n{0}', 610 'assignment to local variables. Affected variables are:\n\n{0}',
611 sb.toString().trim())); 611 sb.toString().trim()));
612 } 612 }
613 // done 613 // done
614 return result; 614 return result;
615 } 615 }
616 616
617 void _initializeReturnType() { 617 void _initializeReturnType() {
618 if (_returnType == null) { 618 if (_selectionFunctionExpression != null) {
619 returnType = '';
620 } else if (_returnType == null) {
619 returnType = 'void'; 621 returnType = 'void';
620 } else { 622 } else {
621 returnType = _getTypeCode(_returnType); 623 returnType = _getTypeCode(_returnType);
622 } 624 }
623 if (returnType == 'dynamic') { 625 if (returnType == 'dynamic') {
624 returnType = ''; 626 returnType = '';
625 } 627 }
626 } 628 }
627 629
628 /** 630 /**
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 return false; 1144 return false;
1143 } 1145 }
1144 for (int i = 0; i < parameterTypes.length; i++) { 1146 for (int i = 0; i < parameterTypes.length; i++) {
1145 if (other.parameterTypes[i] != parameterTypes[i]) { 1147 if (other.parameterTypes[i] != parameterTypes[i]) {
1146 return false; 1148 return false;
1147 } 1149 }
1148 } 1150 }
1149 return true; 1151 return true;
1150 } 1152 }
1151 } 1153 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698