| 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 // DartOptions=--generic-method-syntax |
| 5 // VMOptions=--generic-method-syntax | 6 // VMOptions=--generic-method-syntax |
| 6 | 7 |
| 7 /// Dart test on the usage of method type arguments in a function typed | 8 /// Dart test on the usage of method type arguments in a function typed |
| 8 /// parameter declaration. | 9 /// parameter declaration. |
| 9 | 10 |
| 10 library generic_methods_function_type_test; | 11 library generic_methods_function_type_test; |
| 11 | 12 |
| 12 import "package:expect/expect.dart"; | 13 import "package:expect/expect.dart"; |
| 13 | 14 |
| 14 class C<V> { | 15 class C<V> { |
| 15 U m1<U>(U f(V v), V v) => f(v); | 16 U m1<U>(U f(V v), V v) => f(v); |
| 16 V m2<U>(V f(U v), U u) => f(u); | 17 V m2<U>(V f(U v), U u) => f(u); |
| 17 } | 18 } |
| 18 | 19 |
| 19 main() { | 20 main() { |
| 20 Expect.equals(new C<int>().m1<int>((x) => x, 10), 10); | 21 Expect.equals(new C<int>().m1<int>((x) => x, 10), 10); |
| 21 Expect.equals(new C<int>().m2<int>((x) => x, 20), 20); | 22 Expect.equals(new C<int>().m2<int>((x) => x, 20), 20); |
| 22 } | 23 } |
| 23 | 24 |
| OLD | NEW |