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

Unified Diff: pkg/analyzer/test/src/summary/resynthesize_ast_test.dart

Issue 1897843003: Support for extract property for methods. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart b/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
index 5d0bef80046e3f9c1d83cb1244ae39896681c31b..5b6dad467e70a2ecdd7e416638fab088186c6073 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
@@ -294,9 +294,38 @@ var v = a.b.foo.c;
}
void test_infer_extractProperty_method() {
- checkFile(r'''
+ var unit = checkFile(r'''
+class A {
+ int m(double p1, String p2) => 42;
+}
+var a = new A();
+var v = a.m;
+ ''');
+ expect(unit.topLevelVariables[1].type.toString(), '(double, String) → int');
+ }
+
+ void test_infer_extractProperty_method2() {
+ var unit = checkFile(r'''
var a = 1.round;
''');
+ expect(unit.topLevelVariables[0].type.toString(), '() → int');
+ }
+
+ void test_infer_extractProperty_method_sequence() {
+ var unit = checkFile(r'''
+class A {
+ B b = new B();
+}
+class B {
+ C c = new C();
+}
+class C {
+ int m(double p1, String p2) => 42;
+}
+var a = new A();
+var v = a.b.c.m;
+ ''');
+ expect(unit.topLevelVariables[1].type.toString(), '(double, String) → int');
}
void test_infer_invokeConstructor_factoryRedirected() {
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698