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

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

Issue 14168003: Implement implicit constructors in mixin applications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix an assert. Created 7 years, 7 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 import "package:expect/expect.dart";
6
7 class Base {
8 int i, j;
9 Base.ctor1(int i, this.j) : this.i = i + 7;
10 Base.ctor2(int i, this.j) : this.i = i + 8;
11 }
12
13 abstract class M {
14 get i;
15 get j;
16 int k = 42;
17 foo() => i + j;
18 }
19
20 class C extends Base with M {
21 int l = 131;
22 C.ctor1() : super.ctor1(1, 13);
23 C.ctor2() : super.ctor2(1, 13);
24 }
25
26 main() {
27 C c1 = new C.ctor1();
28 Expect.equals(8, c1.i);
29 Expect.equals(13, c1.j);
30 Expect.equals(42, c1.k);
31 Expect.equals(131, c1.l);
32 Expect.equals(21, c1.foo());
33 C c2 = new C.ctor2();
34 Expect.equals(9, c2.i);
35 Expect.equals(13, c2.j);
36 Expect.equals(42, c2.k);
37 Expect.equals(131, c2.l);
38 Expect.equals(22, c2.foo());
39 }
OLDNEW
« no previous file with comments | « tests/language/language.status ('k') | tests/language/mixin_super_constructor_default_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698