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

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

Issue 2814443005: Fix for summarization of generic function type aliases and support for resynthesizing. (Closed)
Patch Set: Created 3 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/test/src/summary/element_text.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/resynthesize_common.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart
index f1f30f29e38a93075f37893c8b720260057274bf..01a9f0fa817f376d0f06f29478080397ace6c3ad 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -13975,8 +13975,50 @@ typedef dynamic F();
}
test_typedef_generic() {
- checkLibrary(
- 'typedef F<T> = Function<S>(List<S> list, Function<A>(A), T);');
+ var library = checkLibrary(
+ 'typedef F<T> = int Function<S>(List<S> list, num Function<A>(A), T);');
+ if (isStrongMode) {
+ checkElementText(
+ library,
+ r'''
+typedef F<T> = int Function<S>(List<S> list, <A>(A) → num , T );
+''');
+ } else {
+ checkElementText(
+ library,
+ r'''
+typedef F<T> = int Function<S>(List<S> list, <A>(A) → num , T );
+''');
+ }
+ }
+
+ test_typedef_generic_asFieldType() {
+ shouldCompareLibraryElements = false;
+ var library = checkLibrary(r'''
+typedef Foo<S> = S Function<T>(T x);
+class A {
+ Foo<int> f;
+}
+''');
+ if (isStrongMode) {
+ checkElementText(
+ library,
+ r'''
+typedef Foo<S> = S Function<T>(T x);
+class A {
+ <T>(T) → int f;
+}
+''');
+ } else {
+ checkElementText(
+ library,
+ r'''
+typedef Foo<S> = S Function<T>(T x);
+class A {
+ <T>(T) → int f;
+}
+''');
+ }
}
test_typedef_parameter_parameters() {
« no previous file with comments | « pkg/analyzer/test/src/summary/element_text.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