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

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

Issue 2931123002: Fix for resynthesizing generic functions during linking. (Closed)
Patch Set: Created 3 years, 6 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/lib/src/summary/link.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/linker_test.dart
diff --git a/pkg/analyzer/test/src/summary/linker_test.dart b/pkg/analyzer/test/src/summary/linker_test.dart
index 01a6c44b747fb5b4327b83d3b8661a8eb8fe0849..38796c203823736d90caf85d085c37faea3d34e5 100644
--- a/pkg/analyzer/test/src/summary/linker_test.dart
+++ b/pkg/analyzer/test/src/summary/linker_test.dart
@@ -458,6 +458,32 @@ class C extends B {
expect(cls.methods[0].returnType.toString(), 'void');
}
+ void test_inferredType_parameter_genericFunctionType() {
+ var bundle = createPackageBundle(
+ '''
+class A<T> {
+ A<R> map<R>(R Function(T) f) => null;
+}
+''',
+ path: '/a.dart');
+ addBundle('/a.ds', bundle);
+ createLinker('''
+import 'a.dart';
+class C extends A<int> {
+ map<R2>(f) => null;
+}
+''');
+ LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
+ library.libraryCycleForLink.ensureLinked();
+ ClassElementForLink_Class c = library.getContainedName('C');
+ expect(c.methods, hasLength(1));
+ MethodElementForLink map = c.methods[0];
+ expect(map.parameters, hasLength(1));
+ FunctionType fType = map.parameters[0].type;
+ expect(fType.returnType.toString(), 'R2');
+ expect(fType.parameters[0].type.toString(), 'int');
+ }
+
void test_inferredType_staticField_dynamic() {
createLinker('''
dynamic x = null;
« no previous file with comments | « 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