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

Unified Diff: tests/language/generic_methods_generic_function_parameter_test.dart

Issue 2333973002: Add new language test for generic function parameter (filed issue #27299). (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | tests/language/generic_methods_generic_function_parameter_test.options » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/generic_methods_generic_function_parameter_test.dart
diff --git a/tests/language/type_variable_closure4_test.dart b/tests/language/generic_methods_generic_function_parameter_test.dart
similarity index 54%
copy from tests/language/type_variable_closure4_test.dart
copy to tests/language/generic_methods_generic_function_parameter_test.dart
index e75bc085dc16f134f4259bcc0a0deca6b08f995e..81eeade55f528f915cca397c9b3f3944335a1a7c 100644
--- a/tests/language/type_variable_closure4_test.dart
+++ b/tests/language/generic_methods_generic_function_parameter_test.dart
@@ -1,19 +1,18 @@
// Copyright (c) 2016, 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 file.
+//
+// DartOptions=--generic-method-syntax
+// VMOptions=--generic-method-syntax
import "package:expect/expect.dart";
-class A<T> {}
-
class C<T> {
- map() {
- return () => <T, T>{};
- }
+ bar<V>(T t, int u, V v) => t + u + v;
+ foo<U>(bar<V>(T t, U u, V v)) => bar<int>(1, 2, 3);
}
main() {
- Expect.isTrue(new C<int>().map()() is Map<int, int>);
- Expect.isFalse(new C<int>().map()() is Map<String, int>);
- Expect.isFalse(new C<int>().map()() is Map<int, String>);
+ var c = new C<int>();
+ Expect.equals(6, c.foo<int>(c.bar));
}
« no previous file with comments | « no previous file | tests/language/generic_methods_generic_function_parameter_test.options » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698