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: tool/input_sdk/private/ddc_runtime/classes.dart

Issue 1930323004: instantiate generic tear-offs, fixes #525 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: format Created 4 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 | « test/codegen/language/generic_tearoff_test.dart ('k') | tool/input_sdk/private/ddc_runtime/operations.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/private/ddc_runtime/classes.dart
diff --git a/tool/input_sdk/private/ddc_runtime/classes.dart b/tool/input_sdk/private/ddc_runtime/classes.dart
index 27c25427184a938f89ed3d74978f5d7a6189e45a..56920e109f8d93a0dc9f23f5df363ff23d63c392 100644
--- a/tool/input_sdk/private/ddc_runtime/classes.dart
+++ b/tool/input_sdk/private/ddc_runtime/classes.dart
@@ -170,6 +170,17 @@ bind(obj, name, f) => JS('', '''(() => {
return $f;
})()''');
+/// Instantiate a generic method.
+///
+/// We need to apply the type arguments both to the function, as well as its
+/// associated function type.
+gbind(f, @rest typeArgs) {
+ var result = JS('', '#(...#)', f, typeArgs);
+ var sig = JS('', '#(...#)', _getRuntimeType(f), typeArgs);
+ tag(result, sig);
+ return result;
+}
+
// Set up the method signature field on the constructor
_setMethodSignature(f, sigF) => JS('', '''(() => {
$defineMemoizedGetter($f, $_methodSig, () => {
« no previous file with comments | « test/codegen/language/generic_tearoff_test.dart ('k') | tool/input_sdk/private/ddc_runtime/operations.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698