| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import | 6 import |
| 7 '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' | 7 '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' |
| 8 show TypeMask; | 8 show TypeMask; |
| 9 | 9 |
| 10 import 'compiler_helper.dart'; | 10 import 'compiler_helper.dart'; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 class B extends A { | 33 class B extends A { |
| 34 B(int foo, this.bar) : super(foo); | 34 B(int foo, this.bar) : super(foo); |
| 35 int bar; | 35 int bar; |
| 36 operator==(other) { | 36 operator==(other) { |
| 37 if (other.bar != bar) return false; | 37 if (other.bar != bar) return false; |
| 38 return other.foo == foo; | 38 return other.foo == foo; |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 | 41 |
| 42 main() { | 42 main() { |
| 43 var both = [new A(inscrutable(0) == 0 ? 42 : "fish"), | 43 var a = new A(inscrutable(0) == 0 ? 42 : "fish"); |
| 44 new B(0, inscrutable(0) == 0 ? 2 : "horse")]; | 44 var b = new B(0, inscrutable(0) == 0 ? 2 : "horse"); |
| 45 if (both[1] == both[0]) { | 45 var c = inscrutable(0) == 0 ? a : "kurt"; |
| 46 var d = inscrutable(0) == 0 ? b : "gert"; |
| 47 if (c == d) { |
| 46 print("hestfisk"); | 48 print("hestfisk"); |
| 47 } | 49 } |
| 48 } | 50 } |
| 49 """; | 51 """; |
| 50 | 52 |
| 51 void main() { | 53 void main() { |
| 52 String generated = compileAll(TEST); | 54 String generated = compileAll(TEST); |
| 53 if (!generated.contains(r'if ($.$eq(both[1], both[0]))')) { | 55 if (!generated.contains(r'if ($.$eq(c, d))')) { |
| 54 print(generated); | 56 print(generated); |
| 55 Expect.fail("missing elision of '=== true'"); | 57 Expect.fail("missing elision of '=== true'"); |
| 56 } | 58 } |
| 57 } | 59 } |
| OLD | NEW |