OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Check that function types are accepted for constructor arguments that | 4 // Check that function types are accepted for constructor arguments that |
5 // initialize fields. | 5 // initialize fields. |
6 | 6 |
7 import "package:expect/expect.dart"; | |
8 | |
9 class A { | 7 class A { |
10 Function f; | 8 Function f; |
11 A(int this.f()); | 9 A(int this.f()); |
12 } | 10 } |
13 | 11 |
14 main() { | 12 main() { |
15 var a = new A(() => 499); | 13 var a = new A(() => 499); |
16 Expect.equals(499, (a.f)()); | 14 Expect.equals(499, (a.f)()); |
17 } | 15 } |
OLD | NEW |