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

Side by Side Diff: tests/language_strong/type_propagation_assert_assignable_test.dart

Issue 3007803002: Migrate block 162 to Dart 2.0.
Patch Set: Created 3 years, 3 months 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
OLDNEW
(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 // Check that type of the AssertAssignable is recomputed correctly.
5 // VMOptions=--optimization-counter-threshold=10 --no-use-osr
6
7 import "package:expect/expect.dart";
8
9 class A {
10 final p;
11 final _b;
12
13 b() {
14 try {
15 return _b;
16 } catch (e) {}
17 }
18
19 A(this.p, this._b);
20 }
21
22 class B extends A {
23 B(p, b) : super(p, b);
24 }
25
26 bar(v) {
27 for (var x = v; x != null; x = x.p) {
28 if (x.b()) {
29 return x;
30 }
31 }
32 return null;
33 }
34
35 foo(v) {
36 A x = bar(v);
37 return x != null;
38 }
39
40 main() {
41 final a = new A(new B(new A("haha", true), false), false);
42
43 for (var i = 0; i < 20; i++) {
44 Expect.isTrue(foo(a));
45 }
46 Expect.isTrue(foo(a));
47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698