OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // Regression test for dart2js that used to infer that code following |
| 6 // a dynamic call could assume the receiver is not null. This does not |
| 7 // work for Object methods. |
| 8 |
| 9 import "package:expect/expect.dart"; |
| 10 import "compiler_annotations.dart"; |
| 11 |
| 12 main() { |
| 13 var a = true ? null : 42; |
| 14 a.toString(); |
| 15 foo(a); |
| 16 } |
| 17 |
| 18 @DontInline() |
| 19 foo(a) { |
| 20 var f = () => 42; |
| 21 Expect.throws(() => a + 42, (e) => e is NoSuchMethodError); |
| 22 } |
OLD | NEW |