| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011, 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 operator negate() => this; |
| 7 toString() => "5"; |
| 8 abs() => "correct"; |
| 9 } |
| 10 |
| 11 // This triggered a bug in Dart2Js: the speculative type optimization assigned |
| 12 // type "number" to 'a' and then to '-a'. In the bailout version the type for |
| 13 // 'a' was removed, but the type for '-a' was kept. |
| 14 foo(a) => -(-a); |
| 15 |
| 16 main() { |
| 17 Expect.equals("correct", foo(new A()).abs()); |
| 18 } |
| OLD | NEW |