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

Unified Diff: pkg/analyzer/test/src/summary/summary_common.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
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_test.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/summary_common.dart
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index 2173c3bee0270da5a701a6bcd2cdf07d59f57c41..f0588a8573f531904291db99089e7ef23679c8a1 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -3187,6 +3187,30 @@ class D extends C {
]);
}
+ test_constructor_redirected_factory_named_generic() {
+ String text = '''
+class C<T, U> {
+ factory C() = D<U, T>.named;
+ C._();
+}
+class D<T, U> extends C<U, T> {
+ D.named() : super._();
+}
+''';
+ UnlinkedExecutable executable =
+ serializeClassText(text, className: 'C').executables[0];
+ expect(executable.isRedirectedConstructor, isTrue);
+ expect(executable.isFactory, isTrue);
+ expect(executable.redirectedConstructorName, isEmpty);
+ checkTypeRef(executable.redirectedConstructor, null, null, 'named',
+ expectedKind: ReferenceKind.constructor,
+ prefixExpectations: [
+ new _PrefixExpectation(ReferenceKind.classOrEnum, 'D',
+ numTypeParameters: 2)
+ ],
+ allowTypeParameters: true);
+ }
+
test_constructor_redirected_factory_unnamed() {
String text = '''
class C {
@@ -3205,6 +3229,25 @@ class D extends C {
checkTypeRef(executable.redirectedConstructor, null, null, 'D');
}
+ test_constructor_redirected_factory_unnamed_generic() {
+ String text = '''
+class C<T, U> {
+ factory C() = D<U, T>;
+ C._();
+}
+class D<T, U> extends C<U, T> {
+ D() : super._();
+}
+''';
+ UnlinkedExecutable executable =
+ serializeClassText(text, className: 'C').executables[0];
+ expect(executable.isRedirectedConstructor, isTrue);
+ expect(executable.isFactory, isTrue);
+ expect(executable.redirectedConstructorName, isEmpty);
+ checkTypeRef(executable.redirectedConstructor, null, null, 'D',
+ allowTypeParameters: true, numTypeParameters: 2);
+ }
+
test_constructor_redirected_thisInvocation_named() {
String text = '''
class C {
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698