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

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

Issue 2973673002: Fix a bug in inline method refactoring (Closed)
Patch Set: Created 3 years, 5 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/correction/util.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/inline_method_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/inline_method_test.dart b/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
index 65a1dce138f37362114d856a0802544f186e7250..64c50e0895491f6d1d4674351b5ca3ce388e5186 100644
--- a/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
@@ -251,6 +251,51 @@ main() {
return _assertConditionsError('Ambiguous return value.');
}
+ test_cascadeInCascade() async {
+ await indexTestUnit(r'''
+class Inner {
+ String a;
+ String b;
+}
+
+class Outer {
+ Inner inner;
+}
+
+void main() {
+ Inner createInner() => new Inner()
+ ..a = 'a'
+ ..b = 'b';
+
+ final value = new Outer()
+ ..inner = createInner();
+}
+''');
+ _createRefactoring('createInner();');
+ // validate change
+ return _assertSuccessfulRefactoring(r'''
+class Inner {
+ String a;
+ String b;
+}
+
+class Outer {
+ Inner inner;
+}
+
+void main() {
+ Inner createInner() => new Inner()
+ ..a = 'a'
+ ..b = 'b';
+
+ final value = new Outer()
+ ..inner = (new Inner()
+ ..a = 'a'
+ ..b = 'b');
+}
+''');
+ }
+
test_fieldAccessor_getter() async {
await indexTestUnit(r'''
class A {
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698