| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // | 4 // |
| 5 // VMOptions=--generic-method-syntax | 5 // VMOptions=--generic-method-syntax |
| 6 | 6 |
| 7 /// Dart test on the usage of method type arguments in a function typed | 7 /// Dart test on the usage of method type arguments in a function typed |
| 8 /// parameter declaration. | 8 /// parameter declaration. |
| 9 | 9 |
| 10 library generic_methods_function_type_test; | 10 library generic_methods_function_type_test; |
| 11 | 11 |
| 12 import "package:expect/expect.dart"; | 12 import "package:expect/expect.dart"; |
| 13 | 13 |
| 14 class C<V> { | 14 class C<V> { |
| 15 U m1<U>(U f(V v), V v) => f(v); | 15 U m1<U>(U f(V v), V v) => f(v); |
| 16 V m2<U>(V f(U v), U u) => f(u); | 16 V m2<U>(V f(U v), U u) => f(u); |
| 17 } | 17 } |
| 18 | 18 |
| 19 main() { | 19 main() { |
| 20 Expect.equals(new C<int>().m1<int>((x) => x, 10), 10); | 20 Expect.equals(new C<int>().m1<int>((x) => x, 10), 10); |
| 21 Expect.equals(new C<int>().m2<int>((x) => x, 20), 20); | 21 Expect.equals(new C<int>().m2<int>((x) => x, 20), 20); |
| 22 } | 22 } |
| 23 | |
| OLD | NEW |