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 static const fields are compile time constants. | 4 // Check that initializers of static const fields are compile time constants. |
5 | 5 |
6 class CanonicalConstTest { | 6 class CanonicalConstTest { |
7 static final A = const C1(); | 7 static final A = const C1(); |
8 static final B = const C2(); | 8 static final B = const C2(); |
9 | 9 |
10 static testMain() { | 10 static testMain() { |
(...skipping 24 matching lines...) Expand all Loading... |
35 const C1(); | 35 const C1(); |
36 } | 36 } |
37 | 37 |
38 class C2 extends C1 { | 38 class C2 extends C1 { |
39 const C2() : super(); | 39 const C2() : super(); |
40 } | 40 } |
41 | 41 |
42 main() { | 42 main() { |
43 CanonicalConstTest.testMain(); | 43 CanonicalConstTest.testMain(); |
44 } | 44 } |
OLD | NEW |