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

Side by Side Diff: tests/language/mixin_super_constructor_positionals_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.ctor(int this.i, [int this.j = 10]);
10 }
11
12 abstract class M {
13 get i;
14 get j;
15 int k = 42;
16 foo() => i + j;
17 }
18
19 class C extends Base with M {
20 int l = 131;
21 C.foo() : super.ctor(1, 13);
22 C.bar() : super.ctor(1);
23 }
24
25 main() {
26 C c1 = new C.foo();
27 Expect.equals(1, c1.i);
28 Expect.equals(13, c1.j);
29 Expect.equals(14, c1.foo());
30 Expect.equals(42, c1.k);
31 Expect.equals(131, c1.l);
32 C c2 = new C.bar();
33 Expect.equals(1, c2.i);
34 Expect.equals(10, c2.j);
35 Expect.equals(11, c2.foo());
36 Expect.equals(42, c2.k);
37 Expect.equals(131, c2.l);
38 }
OLDNEW
« no previous file with comments | « tests/language/mixin_super_constructor_named_test.dart ('k') | tests/language/mixin_super_constructor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698