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

Side by Side Diff: pkg/kernel/testcases/input/escape.dart

Issue 2825063002: Move kernel baseline tests to front_end. (Closed)
Patch Set: Created 3 years, 8 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 class A {
2 var field;
3 }
4
5 class B {
6 var field;
7 }
8
9 class C {
10 operator ==(x) => false;
11 }
12
13 class X implements A, B {
14 var field;
15 }
16
17 void useAsA(A object) {
18 var _ = object.field;
19 }
20
21 void useAsB(B object) {
22 var _ = object.field;
23 escape(object);
24 }
25
26 void escape(x) {
27 x ??= "";
28 x ??= 45;
29 if (x is! int && x is! String) {
30 x.field = 45;
31 }
32 }
33
34 main() {
35 // escape("");
36 // escape(45);
37
38 var object = new X();
39 useAsA(new A());
40 useAsA(object);
41
42 useAsB(new B());
43 useAsB(object);
44 }
OLDNEW
« no previous file with comments | « pkg/kernel/testcases/input/covariant_generic.dart ('k') | pkg/kernel/testcases/input/external.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698