| 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 final x = "foo"; | |
| 6 final y = "foo"; | |
| 7 final g1 = x | |
| 8 + "bar" // TODO(lrn) - see below: 01: compile-time error | |
| 9 ; | |
| 10 final g2 = x | |
| 11 + null /// 02: compile-time error | |
| 12 ; | |
| 13 final g3 = x | |
| 14 + 499 /// 03: compile-time error | |
| 15 ; | |
| 16 final g4 = x | |
| 17 + 3.3 /// 04: compile-time error | |
| 18 ; | |
| 19 final g5 = x | |
| 20 + true /// 05: compile-time error | |
| 21 ; | |
| 22 final g6 = x | |
| 23 + false /// 06: compile-time error | |
| 24 ; | |
| 25 final g7 = "foo" | |
| 26 + x[0] /// 07: compile-time error | |
| 27 ; | |
| 28 final g8 = 1 | |
| 29 + x.length /// 08: compile-time error | |
| 30 ; | |
| 31 final g9 = x == y; | |
| 32 | |
| 33 use(x) => x; | |
| 34 | |
| 35 main() { | |
| 36 Expect.equals("foobar", g1); | |
| 37 Expect.isTrue(g9); | |
| 38 use(g1); // TODO(lrn): Should fail when String.operator+ is removed. | |
| 39 use(g2); | |
| 40 use(g3); | |
| 41 use(g4); | |
| 42 use(g5); | |
| 43 use(g6); | |
| 44 use(g7); | |
| 45 use(g8); | |
| 46 } | |
| OLD | NEW |