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

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

Issue 8958011: One more factory -> default pass. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years 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) 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 testing factories. 4 // Dart test program for testing factories.
5 5
6 interface Link<T> extends Iterable<T> factory LinkFactory<T> { 6 interface Link<T> extends Iterable<T> default LinkFactory<T> {
7 Link(T head, [Link<T> tail]); 7 Link(T head, [Link<T> tail]);
8 Link<T> prepend(T element); 8 Link<T> prepend(T element);
9 } 9 }
10 10
11 interface EmptyLink<T> extends Link<T> default LinkTail<T> { 11 interface EmptyLink<T> extends Link<T> default LinkTail<T> {
12 const EmptyLink(); 12 const EmptyLink();
13 } 13 }
14 14
15 class LinkFactory<T> { 15 class LinkFactory<T> {
16 factory Link(head, [Link tail]) { 16 factory Link(head, [Link tail]) {
(...skipping 18 matching lines...) Expand all
35 class Fisk { 35 class Fisk {
36 Link<String> nodes = const EmptyLink(); 36 Link<String> nodes = const EmptyLink();
37 } 37 }
38 38
39 main() { 39 main() {
40 new Fisk(); 40 new Fisk();
41 new EmptyLink<String>().prepend('hest'); 41 new EmptyLink<String>().prepend('hest');
42 const EmptyLink<String>().prepend('fisk'); 42 const EmptyLink<String>().prepend('fisk');
43 } 43 }
44 44
OLDNEW
« no previous file with comments | « dart/tests/language/src/DefaultImplementationTest.dart ('k') | dart/tests/language/src/Factory3Test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698