| 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 | 6 |
| 7 main() { | 7 main() { |
| 8 const f0 = 42; | 8 const f0 = 42; |
| 9 const f1; /// 01: compile-time error | 9 const f1; /// 01: compile-time error |
| 10 const int f2 = 87; | 10 const int f2 = 87; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 Expect.isTrue(A0 is int); | 25 Expect.isTrue(A0 is int); |
| 26 Expect.isTrue(A1 is int); | 26 Expect.isTrue(A1 is int); |
| 27 Expect.isTrue(A2 is int); /// 08: compile-time error | 27 Expect.isTrue(A2 is int); /// 08: compile-time error |
| 28 Expect.isTrue(A3 is int); /// 08: continued | 28 Expect.isTrue(A3 is int); /// 08: continued |
| 29 | 29 |
| 30 Expect.isTrue(C0.X is C1); | 30 Expect.isTrue(C0.X is C1); |
| 31 Expect.isTrue(C0.X.x is C1); /// 09: compile-time error | 31 Expect.isTrue(C0.X.x is C1); /// 09: compile-time error |
| 32 | 32 |
| 33 Expect.equals("Hello 42", B2); | 33 Expect.equals("Hello 42", B2); |
| 34 Expect.equals("42Hello", B3); /// 10: compile-time error | 34 Expect.equals("42Hello", B3); /// 10: compile-time error |
| 35 |
| 36 const cf1 = identical(const Point(1, 2), const Point(1, 2)); |
| 37 |
| 38 const cf2 = identical(const Point(1, 2), new Point(1, 2)); /// 11: compile-ti
me error |
| 39 |
| 40 var f4 = B4; /// 12: compile-time error |
| 41 var f5 = B5; |
| 35 } | 42 } |
| 36 | 43 |
| 37 const F0 = 42; | 44 const F0 = 42; |
| 38 const F1; /// 03: continued | 45 const F1; /// 03: continued |
| 39 const int F2 = 87; | 46 const int F2 = 87; |
| 40 const int F3; /// 04: continued | 47 const int F3; /// 04: continued |
| 41 | 48 |
| 42 class Point { | 49 class Point { |
| 43 final x, y; | 50 final x, y; |
| 44 const Point(this.x, this.y); | 51 const Point(this.x, this.y); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 68 : x = C0.X /// 09: continued | 75 : x = C0.X /// 09: continued |
| 69 ; | 76 ; |
| 70 final x = null; | 77 final x = null; |
| 71 } | 78 } |
| 72 | 79 |
| 73 // Check that sub-expressions of binary + are numeric. | 80 // Check that sub-expressions of binary + are numeric. |
| 74 const B0 = 42; | 81 const B0 = 42; |
| 75 const B1 = "Hello"; | 82 const B1 = "Hello"; |
| 76 const B2 = "$B1 $B0"; | 83 const B2 = "$B1 $B0"; |
| 77 const B3 = B0 + B1; /// 10: continued | 84 const B3 = B0 + B1; /// 10: continued |
| 85 |
| 86 // Check identical. |
| 87 |
| 88 const B4 = identical(1, new Point(1,2)); |
| 89 const B5 = identical(1, const Point(1,2)); |
| OLD | NEW |