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

Unified Diff: pkg/analysis_server/test/services/refactoring/extract_method_test.dart

Issue 832343004: Issue 21959. Check that type of parameters in 'Extract Method' occurrences are exactly the same. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/refactoring/extract_method.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6dd4e10e09f9ee9239fde2a96611506c570448fd..ba6a7d61b79e091ae7051327081157e072baec1c 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
@@ -1306,6 +1306,29 @@ main() {
''');
}
+ test_singleExpression_occurrences_incompatibleTypes() {
+ indexTestUnit('''
+main() {
+ int x = 1;
+ String y = 'foo';
+ print(x.toString());
+ print(y.toString());
+}
+''');
+ _createRefactoringForString('x.toString()');
+ // apply refactoring
+ return _assertSuccessfulRefactoring('''
+main() {
+ int x = 1;
+ String y = 'foo';
+ print(res(x));
+ print(y.toString());
+}
+
+String res(int x) => x.toString();
+''');
+ }
+
test_singleExpression_occurrences_inWholeUnit() {
indexTestUnit('''
main() {
« no previous file with comments | « pkg/analysis_server/lib/src/services/refactoring/extract_method.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698