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

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

Issue 1687513003: Fix summarization of generic redirecting constructors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/analyzer/test/src/summary/resynthesize_test.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart
index d51c40200fe397fbffa8ebab166672d11b2885e0..aa4fd9d64309559daf3c9c403ddb9db9e3baf2f6 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -1915,6 +1915,18 @@ class D extends C {
''');
}
+ test_constructor_redirected_factory_named_generic() {
+ checkLibrary('''
+class C<T, U> {
+ factory C() = D<U, T>.named;
+ C._();
+}
+class D<T, U> extends C<U, T> {
+ D.named() : super._();
+}
+''');
+ }
+
test_constructor_redirected_factory_named_imported() {
addLibrarySource(
'/foo.dart',
@@ -1933,6 +1945,24 @@ class C {
''');
}
+ test_constructor_redirected_factory_named_imported_generic() {
+ addLibrarySource(
+ '/foo.dart',
+ '''
+import 'test.dart';
+class D<T, U> extends C<U, T> {
+ D.named() : super._();
+}
+''');
+ checkLibrary('''
+import 'foo.dart';
+class C<T, U> {
+ factory C() = D<U, T>.named;
+ C._();
+}
+''');
+ }
+
test_constructor_redirected_factory_named_prefixed() {
addLibrarySource(
'/foo.dart',
@@ -1951,6 +1981,24 @@ class C {
''');
}
+ test_constructor_redirected_factory_named_prefixed_generic() {
+ addLibrarySource(
+ '/foo.dart',
+ '''
+import 'test.dart';
+class D<T, U> extends C<U, T> {
+ D.named() : super._();
+}
+''');
+ checkLibrary('''
+import 'foo.dart' as foo;
+class C<T, U> {
+ factory C() = foo.D<U, T>.named;
+ C._();
+}
+''');
+ }
+
test_constructor_redirected_factory_unnamed() {
checkLibrary('''
class C {
@@ -1963,6 +2011,18 @@ class D extends C {
''');
}
+ test_constructor_redirected_factory_unnamed_generic() {
+ checkLibrary('''
+class C<T, U> {
+ factory C() = D<U, T>;
+ C._();
+}
+class D<T, U> extends C<U, T> {
+ D() : super._();
+}
+''');
+ }
+
test_constructor_redirected_factory_unnamed_imported() {
addLibrarySource(
'/foo.dart',
@@ -1981,6 +2041,24 @@ class C {
''');
}
+ test_constructor_redirected_factory_unnamed_imported_generic() {
+ addLibrarySource(
+ '/foo.dart',
+ '''
+import 'test.dart';
+class D<T, U> extends C<U, T> {
+ D() : super._();
+}
+''');
+ checkLibrary('''
+import 'foo.dart';
+class C<T, U> {
+ factory C() = D<U, T>;
+ C._();
+}
+''');
+ }
+
test_constructor_redirected_factory_unnamed_prefixed() {
addLibrarySource(
'/foo.dart',
@@ -1999,6 +2077,24 @@ class C {
''');
}
+ test_constructor_redirected_factory_unnamed_prefixed_generic() {
+ addLibrarySource(
+ '/foo.dart',
+ '''
+import 'test.dart';
+class D<T, U> extends C<U, T> {
+ D() : super._();
+}
+''');
+ checkLibrary('''
+import 'foo.dart' as foo;
+class C<T, U> {
+ factory C() = foo.D<U, T>;
+ C._();
+}
+''');
+ }
+
test_constructor_redirected_thisInvocation_named() {
checkLibrary('''
class C {
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_elements.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698