OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 // Test to check that we can parse closure type formal parameters with | |
6 // default value. | |
7 | |
8 class A { | |
9 | |
10 static Function func; | |
11 | |
12 static SetFunc([String fmt(int i) = null]) { | |
13 func = fmt; | |
14 } | |
15 | |
16 } | |
17 | |
18 main() { | |
19 Expect.equals(null, A.func); | |
20 A.SetFunc((i) => "$i"); | |
21 Expect.equals(false, null == A.func); | |
22 Expect.equals("1234", A.func(1230 + 4)); | |
23 A.SetFunc(); | |
24 Expect.equals(null, A.func); | |
25 } | |
OLD | NEW |