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

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

Issue 3009933002: Resynthesize references to type parameters in default expressions from Kernel. (Closed)
Patch Set: Created 3 years, 4 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_common.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart
index 7eea1b2e325224640bfb5174f7a19870e24b1841..ec6a3106e8d3b7f06b2057bf8bcd568c6e41d7a8 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -5097,7 +5097,19 @@ class C<T> {
const C([B<T> b = const B()]);
}
''');
- checkElementText(library, r'''
+ if (isSharedFrontEnd) {
+ checkElementText(library, r'''
+class B<T> {
+ const B();
+}
+class C<T> {
+ const C([B<T> b = const
+ B/*location: test.dart;B*/<
+ T/*location: test.dart;C;T*/>()]);
+}
+''');
+ } else {
+ checkElementText(library, r'''
class B<T> {
const B();
}
@@ -5106,6 +5118,7 @@ class C<T> {
B/*location: test.dart;B*/()]);
}
''');
+ }
}
test_defaultValue_refersToGenericClass_constructor2() async {
@@ -5118,7 +5131,21 @@ class C<T> implements A<Iterable<T>> {
const C([A<T> a = const B()]);
}
''');
- checkElementText(library, r'''
+ if (isSharedFrontEnd) {
+ checkElementText(library, r'''
+abstract class A<T> {
+}
+class B<T> implements A<T> {
+ const B();
+}
+class C<T> implements A<Iterable<T>> {
+ const C([A<T> a = const
+ B/*location: test.dart;B*/<
+ T/*location: test.dart;C;T*/>()]);
+}
+''');
+ } else {
+ checkElementText(library, r'''
abstract class A<T> {
}
class B<T> implements A<T> {
@@ -5129,6 +5156,7 @@ class C<T> implements A<Iterable<T>> {
B/*location: test.dart;B*/()]);
}
''');
+ }
}
test_defaultValue_refersToGenericClass_functionG() async {
@@ -5138,13 +5166,24 @@ class B<T> {
}
void foo<T>([B<T> b = const B()]) {}
''');
- checkElementText(library, r'''
+ if (isSharedFrontEnd) {
+ checkElementText(library, r'''
+class B<T> {
+ const B();
+}
+void foo<T>([B<T> b = const
+ B/*location: test.dart;B*/<
+ T/*location: test.dart;foo;T*/>()]) {}
+''');
+ } else {
+ checkElementText(library, r'''
class B<T> {
const B();
}
void foo<T>([B<T> b = const
B/*location: test.dart;B*/()]) {}
''');
+ }
}
test_defaultValue_refersToGenericClass_methodG() async {
@@ -5156,7 +5195,19 @@ class C {
void foo<T>([B<T> b = const B()]) {}
}
''');
- checkElementText(library, r'''
+ if (isSharedFrontEnd) {
+ checkElementText(library, r'''
+class B<T> {
+ const B();
+}
+class C {
+ void foo<T>([B<T> b = const
+ B/*location: test.dart;B*/<
+ T/*location: test.dart;C;foo;T*/>()]) {}
+}
+''');
+ } else {
+ checkElementText(library, r'''
class B<T> {
const B();
}
@@ -5165,6 +5216,7 @@ class C {
B/*location: test.dart;B*/()]) {}
}
''');
+ }
}
test_defaultValue_refersToGenericClass_methodG_classG() async {
@@ -5176,7 +5228,20 @@ class C<E1> {
void foo<E2>([B<E1, E2> b = const B()]) {}
}
''');
- checkElementText(library, r'''
+ if (isSharedFrontEnd) {
+ checkElementText(library, r'''
+class B<T1, T2> {
+ const B();
+}
+class C<E1> {
+ void foo<E2>([B<E1, E2> b = const
+ B/*location: test.dart;B*/<
+ E1/*location: test.dart;C;E1*/,
+ E2/*location: test.dart;C;foo;E2*/>()]) {}
+}
+''');
+ } else {
+ checkElementText(library, r'''
class B<T1, T2> {
const B();
}
@@ -5185,6 +5250,7 @@ class C<E1> {
B/*location: test.dart;B*/()]) {}
}
''');
+ }
}
test_defaultValue_refersToGenericClass_methodNG() async {
@@ -5196,7 +5262,19 @@ class C<T> {
void foo([B<T> b = const B()]) {}
}
''');
- checkElementText(library, r'''
+ if (isSharedFrontEnd) {
+ checkElementText(library, r'''
+class B<T> {
+ const B();
+}
+class C<T> {
+ void foo([B<T> b = const
+ B/*location: test.dart;B*/<
+ T/*location: test.dart;C;T*/>()]) {}
+}
+''');
+ } else {
+ checkElementText(library, r'''
class B<T> {
const B();
}
@@ -5205,6 +5283,7 @@ class C<T> {
B/*location: test.dart;B*/()]) {}
}
''');
+ }
}
test_enum_documented() async {
« no previous file with comments | « pkg/analyzer/lib/src/kernel/resynthesize.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698