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

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

Issue 707073002: Fix analyzer's treatment of mixin constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Improve error message. Created 6 years, 1 month 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
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 abstract class Mixin1 { 7 abstract class Mixin1 {
8 var mixin1Field = 1; 8 var mixin1Field = 1;
9 } 9 }
10 10
11 abstract class Mixin2 { 11 abstract class Mixin2 {
12 var mixin2Field = 2; 12 var mixin2Field = 2;
13 } 13 }
14 14
15 class A { 15 class A {
16 var superField; 16 var superField;
17 A([this.superField = 3]); 17 A() : superField = 3;
18 } 18 }
19 19
20 class B extends A with Mixin1, Mixin2 { 20 class B extends A with Mixin1, Mixin2 {
21 var field = 4; 21 var field = 4;
22 } 22 }
23 23
24 main() { 24 main() {
25 var b = new B(); 25 var b = new B();
26 Expect.equals(1, b.mixin1Field); 26 Expect.equals(1, b.mixin1Field);
27 Expect.equals(2, b.mixin2Field); 27 Expect.equals(2, b.mixin2Field);
28 Expect.equals(3, b.superField); 28 Expect.equals(3, b.superField);
29 Expect.equals(4, b.field); 29 Expect.equals(4, b.field);
30 } 30 }
OLDNEW
« no previous file with comments | « tests/language/language_dart2js.status ('k') | tests/language/mixin_forwarding_constructor3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698