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

Unified Diff: tests/compiler/dart2js/kernel/impact_test.dart

Issue 2574193003: Support generic methods in kernel (Closed)
Patch Set: Cleanup Created 4 years 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/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/kernel/impact_test.dart
diff --git a/tests/compiler/dart2js/kernel/impact_test.dart b/tests/compiler/dart2js/kernel/impact_test.dart
index fd2467f8ffeca1c2b38a7f5e24549f7e98444d74..90042ef0843e400dc75cf8b37b3990073f8f0c53 100644
--- a/tests/compiler/dart2js/kernel/impact_test.dart
+++ b/tests/compiler/dart2js/kernel/impact_test.dart
@@ -168,6 +168,8 @@ main() {
testForwardingConstructorTyped();
testForwardingConstructorGeneric();
testEnum();
+ testStaticGenericMethod();
+ testInstanceGenericMethod();
}
testEmpty() {}
@@ -583,6 +585,15 @@ testForwardingConstructorGeneric() {
enum Enum { A }
testEnum() => Enum.A;
+
+List<T> staticGenericMethod<T>(T arg) => [arg];
+testStaticGenericMethod() {
+ staticGenericMethod<int>(0);
+}
+
+testInstanceGenericMethod() {
+ new GenericClass<int, String>.generative().genericMethod<bool>(false);
+}
''',
'helper.dart': '''
class Class {
@@ -594,6 +605,8 @@ class GenericClass<X, Y> {
const GenericClass.generative();
factory GenericClass.fact() => null;
const factory GenericClass.redirect() = GenericClass<X, Y>.generative;
+
+ Map<X, T> genericMethod<T>(T arg) => { null: arg };
}
typedef Typedef();
typedef X GenericTypedef<X, Y>(Y y);
@@ -614,7 +627,9 @@ main(List<String> args) {
]);
compiler.resolution.retainCachesForTesting = true;
await compiler.run(entryPoint);
+ checkLibrary(compiler, compiler.mainApp, fullTest: args.contains('--full'));
compiler.libraryLoader.libraries.forEach((LibraryElement library) {
+ if (library == compiler.mainApp) return;
checkLibrary(compiler, library, fullTest: args.contains('--full'));
});
});
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698