OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Dart test program for testing named parameters. | 4 // Dart test program for testing named parameters. |
5 | 5 |
6 import "package:expect/expect.dart"; | |
7 | |
8 | 6 |
9 class TypeTester<T> {} | 7 class TypeTester<T> {} |
10 | 8 |
11 // Expect compile-time error as no default values are allowed | 9 // Expect compile-time error as no default values are allowed |
12 // in closure type definitions. | 10 // in closure type definitions. |
13 typedef void Callback([String msg | 11 typedef void Callback([String msg |
14 = "" /// 01: compile-time error | 12 = "" /// 01: compile-time error |
15 ]); | 13 ]); |
16 | 14 |
17 class NamedParametersAggregatedTests { | 15 class NamedParametersAggregatedTests { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 ); | 47 ); |
50 | 48 |
51 // Expect compile-time error due to missing positional argument. | 49 // Expect compile-time error due to missing positional argument. |
52 NamedParametersAggregatedTests.F31(b:25, c:35); /// 05: static type warning | 50 NamedParametersAggregatedTests.F31(b:25, c:35); /// 05: static type warning |
53 | 51 |
54 new TypeTester<Callback>(); | 52 new TypeTester<Callback>(); |
55 | 53 |
56 (new NamedParametersAggregatedTests()).InstallCallback(null); | 54 (new NamedParametersAggregatedTests()).InstallCallback(null); |
57 | 55 |
58 } | 56 } |
OLD | NEW |