Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: tests/language/range_analysis3_test.dart

Issue 1504333005: Change confuse() for range_analysis3_test to return non-null int (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698