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

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

Issue 1893703002: Support for a.b.c.d extract property sequence. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: tweak 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
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 dbe650de42c81afc0d0d34b467bcd8526f59ebd2..0de7edf4409406cb98fdb8f3b285de33fa44ee0c 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
@@ -245,6 +245,41 @@ var d = foo.bar;
''');
}
+ void test_infer_extractProperty_getter_sequence() {
+ var unit = checkFile(r'''
+class A {
+ B b = new B();
+}
+class B {
+ C c = new C();
+}
+class C {
+ int d;
+}
+var a = new A();
+var v = a.b.c.d;
+ ''');
+ expect(unit.topLevelVariables[1].type.toString(), 'int');
+ }
+
+
+ void test_infer_extractProperty_getter_sequence_generic() {
+ var unit = checkFile(r'''
+class A<T> {
+ B<T> b = new B<T>();
+}
+class B<K> {
+ C<List<K>, int> c = new C<List<K>, int>();
+}
+class C<K, V> {
+ Map<K, V> d;
+}
+var a = new A<double>();
+var v = a.b.c.d;
+ ''');
+ expect(unit.topLevelVariables[1].type.toString(), 'Map<List<double>, int>');
+ }
+
void test_infer_extractProperty_method() {
checkFile(r'''
var a = 1.round;
« pkg/analyzer/lib/src/summary/link.dart ('K') | « 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