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 // Check that initializers of const fields can be declared out of order. | 4 // Check that initializers of const fields can be declared out of order. |
5 | 5 |
| 6 import "package:expect/expect.dart"; |
| 7 |
6 const P = 2 * (O - N); | 8 const P = 2 * (O - N); |
7 const N = 1; | 9 const N = 1; |
8 const O = 1 + 3; | 10 const O = 1 + 3; |
9 | 11 |
10 int main() { | 12 int main() { |
11 Expect.equals(1, N); | 13 Expect.equals(1, N); |
12 Expect.equals(4, O); | 14 Expect.equals(4, O); |
13 Expect.equals(6, P); | 15 Expect.equals(6, P); |
14 } | 16 } |
OLD | NEW |