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

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

Issue 11953048: Support 'implements' clause on typedef mixin applications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 7 years, 10 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 | Annotate | Revision Log
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
5 abstract class I0 {
6 foo();
7 }
8
9 abstract class I1 {
10 bar();
11 }
12
13 abstract class I2 implements I0, I1 {
14 }
15
16 class M {
17 foo() => 42;
18 bar() => 87;
19 }
20
21 typedef C0 = Object with M;
22 typedef C1 = Object with M implements I0;
23 typedef C2 = Object with M implements I1;
24 typedef C3 = Object with M implements I0, I1;
25 typedef C4 = Object with M implements I1, I0;
26 typedef C5 = Object with M implements I2;
27
28 main() {
29 var c0 = new C0();
30 Expect.equals(42, c0.foo());
31 Expect.equals(87, c0.bar());
32 Expect.isTrue(c0 is M);
33 Expect.isFalse(c0 is I0);
34 Expect.isFalse(c0 is I1);
35 Expect.isFalse(c0 is I2);
36
37 var c1 = new C1();
38 Expect.equals(42, c1.foo());
39 Expect.equals(87, c1.bar());
40 Expect.isTrue(c1 is M);
41 Expect.isTrue(c1 is I0);
42 Expect.isFalse(c1 is I1);
43 Expect.isFalse(c1 is I2);
44
45 var c2 = new C2();
46 Expect.equals(42, c2.foo());
47 Expect.equals(87, c2.bar());
48 Expect.isTrue(c2 is M);
49 Expect.isFalse(c2 is I0);
50 Expect.isTrue(c2 is I1);
51 Expect.isFalse(c1 is I2);
52
53 var c3 = new C3();
54 Expect.equals(42, c3.foo());
55 Expect.equals(87, c3.bar());
56 Expect.isTrue(c3 is M);
57 Expect.isTrue(c3 is I0);
58 Expect.isTrue(c3 is I1);
59 Expect.isFalse(c1 is I2);
60
61 var c4 = new C4();
62 Expect.equals(42, c4.foo());
63 Expect.equals(87, c4.bar());
64 Expect.isTrue(c4 is M);
65 Expect.isTrue(c4 is I0);
66 Expect.isTrue(c4 is I1);
67 Expect.isFalse(c1 is I2);
68
69 var c5 = new C5();
70 Expect.equals(42, c5.foo());
71 Expect.equals(87, c5.bar());
72 Expect.isTrue(c5 is M);
73 Expect.isTrue(c5 is I0);
74 Expect.isTrue(c5 is I1);
75 Expect.isTrue(c5 is I2);
76 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698