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 | 4 |
5 class A { | 5 class A { |
6 final int x; | 6 final int x; |
7 const A.a1() : x = 'foo'; /// 01: continued | 7 const A.a1() : x = 'foo'; //# 01: continued |
8 const A.a2(this.x); | 8 const A.a2(this.x); |
9 const A.a3([this.x = 'foo']); /// 03: continued | 9 const A.a3([this.x = 'foo']); //# 03: continued |
10 const A.a4(String this.x); /// 04: continued | 10 const A.a4(String this.x); //# 04: continued |
11 const A.a5(String x) : this.x = x; /// 05: continued | 11 const A.a5(String x) : this.x = x; //# 05: continued |
12 const A.a6(int x) : this.x = x; | 12 const A.a6(int x) : this.x = x; |
13 } | 13 } |
14 | 14 |
15 var a1 = const A.a1(); /// 01: static type warning, checked mode compile-time er
ror | 15 var a1 = const A.a1(); //# 01: static type warning, checked mode compile-time er
ror |
16 var a2 = const A.a2('foo'); /// 02: static type warning, checked mode compile-ti
me error | 16 var a2 = const A.a2('foo'); //# 02: static type warning, checked mode compile-ti
me error |
17 var a3 = const A.a3(); /// 03: static type warning, checked mode compile-time er
ror | 17 var a3 = const A.a3(); //# 03: static type warning, checked mode compile-time er
ror |
18 var a4 = const A.a4('foo'); /// 04: static type warning, checked mode compile-ti
me error | 18 var a4 = const A.a4('foo'); //# 04: static type warning, checked mode compile-ti
me error |
19 var a5 = const A.a5('foo'); /// 05: static type warning, checked mode compile-ti
me error | 19 var a5 = const A.a5('foo'); //# 05: static type warning, checked mode compile-ti
me error |
20 var a6 = const A.a6('foo'); /// 06: static type warning, checked mode compile-ti
me error | 20 var a6 = const A.a6('foo'); //# 06: static type warning, checked mode compile-ti
me error |
21 | 21 |
22 main() { | 22 main() { |
23 print(a1); /// 01: continued | 23 print(a1); //# 01: continued |
24 print(a2); /// 02: continued | 24 print(a2); //# 02: continued |
25 print(a3); /// 03: continued | 25 print(a3); //# 03: continued |
26 print(a4); /// 04: continued | 26 print(a4); //# 04: continued |
27 print(a5); /// 05: continued | 27 print(a5); //# 05: continued |
28 print(a6); /// 06: continued | 28 print(a6); //# 06: continued |
29 } | 29 } |
OLD | NEW |