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

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

Issue 11886097: Get the most basic mixin applications working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Diff against right branch. Created 7 years, 11 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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/resolution.dart ('k') | 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
(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 class S {
6 foo() => "S-foo";
7 baz() => "S-baz";
8 }
9
10 class M1 {
11 bar() => "M1-bar";
12 }
13
14 class M2 {
15 bar() => "M2-bar";
16 baz() => "M2-baz";
17 }
18
19 typedef C = S with M1;
20 typedef D = S with M1, M2;
21 typedef E = S with M2, M1;
22
23 main() {
24 var c = new C();
25 Expect.equals("S-foo", c.foo());
26 Expect.equals("M1-bar", c.bar());
27 Expect.equals("S-baz", c.baz());
28 Expect.isTrue(c is C);
29 Expect.isFalse(c is D);
30 Expect.isFalse(c is E);
31 Expect.isTrue(c is S);
32 Expect.isFalse(c is M1);
33 Expect.isFalse(c is M2);
gbracha 2013/01/17 18:24:20 So per the current spec, c is M1 should be true.
kasperl 2013/01/18 06:21:10 Thanks, Gilad. Done.
34
35 var d = new D();
36 Expect.equals("S-foo", d.foo());
37 Expect.equals("M2-bar", d.bar());
38 Expect.equals("M2-baz", d.baz());
39 Expect.isFalse(d is C);
40 Expect.isTrue(d is D);
41 Expect.isFalse(d is E);
42 Expect.isTrue(d is S);
43 Expect.isFalse(d is M1);
44 Expect.isFalse(d is M2);
45
46 var e = new E();
47 Expect.equals("S-foo", e.foo());
48 Expect.equals("M1-bar", e.bar());
49 Expect.equals("M2-baz", e.baz());
50 Expect.isFalse(e is C);
51 Expect.isFalse(e is D);
52 Expect.isTrue(e is E);
53 Expect.isTrue(e is S);
54 Expect.isFalse(e is M1);
55 Expect.isFalse(e is M2);
56 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/resolution.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698