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

Side by Side Diff: dart/tests/language/src/ConstructorRedirectTest.dart

Issue 9663065: Fix ConstructorRedirectTest. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 | « dart/tests/language/language-leg.status ('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
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Dart test program for redirection constructors. 4 // Dart test program for redirection constructors.
5 5
6 class A { 6 class A {
7 var x; 7 var x;
8 A(this.x) {} 8 A(this.x) {}
9 A.named(x, int y) : this(x + y); 9 A.named(x, int y) : this(x + y);
10 A.named2(int x, int y, z) : this.named(staticFun(x, y), z); 10 A.named2(int x, int y, z) : this.named(staticFun(x, y), z);
11 11
12 static
kasperl 2012/03/12 12:14:36 Maybe add a comment that explain why this works?
ahe 2012/03/12 15:48:28 Done.
13 moreStaticFun() {} /// 01: compile-time error
12 int staticFun(int v1, int v2) { 14 int staticFun(int v1, int v2) {
13 return v1 * v2; 15 return v1 * v2;
14 } 16 }
15 } 17 }
16 18
17 class B extends A { 19 class B extends A {
18 B(y) : super(y + 1) {} 20 B(y) : super(y + 1) {}
19 B.named(y) : super.named(y, y + 1) {} 21 B.named(y) : super.named(y, y + 1) {}
20 } 22 }
21 23
(...skipping 30 matching lines...) Expand all
52 D d = const D(498); 54 D d = const D(498);
53 Expect.equals(499, d.x); 55 Expect.equals(499, d.x);
54 d = const D.named(249); 56 d = const D.named(249);
55 Expect.equals(499, d.x); 57 Expect.equals(499, d.x);
56 } 58 }
57 } 59 }
58 60
59 main() { 61 main() {
60 ConstructorRedirectTest.testMain(); 62 ConstructorRedirectTest.testMain();
61 } 63 }
OLDNEW
« no previous file with comments | « dart/tests/language/language-leg.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698