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