OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 | 4 |
5 library fieldtest; | 5 library fieldtest; |
6 | 6 |
7 class A { | 7 class A { |
8 int x = 42; | 8 int x = 42; |
9 } | 9 } |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 int foo = 2; | 44 int foo = 2; |
45 int bar = 3; | 45 int bar = 3; |
46 } | 46 } |
47 | 47 |
48 class Generic<T> { | 48 class Generic<T> { |
49 foo(T t) => print(bar + t); | 49 foo(T t) => print(bar + t); |
50 | 50 |
51 static String bar = 'hello'; | 51 static String bar = 'hello'; |
52 } | 52 } |
53 | 53 |
| 54 class StaticFieldOrder1 { |
| 55 static const a = b + 1; |
| 56 static const c = d + 2; |
| 57 static const b = c + 3; |
| 58 static const d = 4; |
| 59 } |
| 60 class StaticFieldOrder2 { |
| 61 static const a = StaticFieldOrder2.b + 1; |
| 62 static const c = StaticFieldOrder2.d + 2; |
| 63 static const b = StaticFieldOrder2.c + 3; |
| 64 static const d = 4; |
| 65 } |
| 66 |
54 void main() { | 67 void main() { |
55 var a = new A(); | 68 var a = new A(); |
56 foo(a); | 69 foo(a); |
57 bar(a); | 70 bar(a); |
58 print(baz(a)); | 71 print(baz(a)); |
59 | 72 |
60 print(new Generic<String>().foo(' world')); | 73 print(new Generic<String>().foo(' world')); |
61 } | 74 } |
OLD | NEW |