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