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

Unified Diff: pkg/analysis_server/test/services/refactoring/extract_method_test.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, 10 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/services/refactoring/extract_method_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
index a092f1e78a71491d9d4b8a217d4fe756e7b7c76d..560847c58eae36c64088fe2ccb81fc1ef5a10bcc 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
@@ -1058,6 +1058,19 @@ main() {
expect(refactoring.returnType, 'double');
}
+ test_returnType_closure() async {
+ indexTestUnit('''
+process(f(x)) {}
+main() {
+ process((x) => x * 2);
+}
+''');
+ _createRefactoringForString('(x) => x * 2');
+ // do check
+ await refactoring.checkInitialConditions();
+ expect(refactoring.returnType, '');
+ }
+
test_returnType_statements_nullMix() async {
indexTestUnit('''
main(bool p) {
« no previous file with comments | « pkg/analysis_server/lib/src/services/refactoring/extract_method.dart ('k') | pkg/analysis_server/tool/spec/spec_input.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698