OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 | 6 |
7 @NoInline() @AssumeDynamic() | 7 @NoInline() |
8 confuse(x) => x; | 8 @AssumeDynamic() |
| 9 confuse(x) => x is int ? x : 0; |
9 | 10 |
10 test1() { | 11 test1() { |
11 int x = 0; | 12 int x = 0; |
12 // Give x a range of -1 to 0. | 13 // Give x a range of -1 to 0. |
13 if (confuse(0) == 1) x = -1; | 14 if (confuse(0) == 1) x = -1; |
14 | 15 |
15 int y = 0; | 16 int y = 0; |
16 // Give y a range of 0 to 1. | 17 // Give y a range of 0 to 1. |
17 if (confuse(0) == 1) y = 1; | 18 if (confuse(0) == 1) y = 1; |
18 | 19 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 196 } |
196 | 197 |
197 main() { | 198 main() { |
198 test1(); | 199 test1(); |
199 test2(); | 200 test2(); |
200 test3a(); | 201 test3a(); |
201 test3b(); | 202 test3b(); |
202 test4a(); | 203 test4a(); |
203 test4b(); | 204 test4b(); |
204 } | 205 } |
OLD | NEW |