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

Unified Diff: pkg/kernel/testcases/closures/captured_class_type_vars.dart

Issue 2998803002: [kernel] Support for top-level generic functions. (Closed)
Patch Set: Review comments. 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/kernel/testcases/closures/captured_class_type_vars.dart
diff --git a/pkg/kernel/testcases/closures/captured_class_type_vars.dart b/pkg/kernel/testcases/closures/captured_class_type_vars.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5767a93c1c23272d6148d483756d5aee3582709e
--- /dev/null
+++ b/pkg/kernel/testcases/closures/captured_class_type_vars.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE.md file.
+
+class Isgen<B> {
+ getfn() {
+ return (x) => x is B;
+ }
+}
+
+main() {
+ int x = 3;
+ var isgen = new Isgen<String>();
+ var iser = isgen.getfn();
+ assert(!iser(x));
+}

Powered by Google App Engine
This is Rietveld 408576698