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

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

Issue 14022007: Move Iterable implementation to collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Merge to head. Created 7 years, 8 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 | « tests/language/factory2_test.dart ('k') | utils/apidoc/mdn/extract.dart » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // VMOptions=--enable_checked_mode 4 // VMOptions=--enable_checked_mode
5 5
6 abstract class Link<T> extends Iterable<T> { 6 import "dart:collection";
7
8 abstract class Link<T> extends IterableBase<T> {
7 factory Link(T head, [Link<T> tail]) = LinkEntry<T>; 9 factory Link(T head, [Link<T> tail]) = LinkEntry<T>;
8 Link<T> prepend(T element); 10 Link<T> prepend(T element);
9 } 11 }
10 12
11 abstract class EmptyLink<T> extends Link<T> { 13 abstract class EmptyLink<T> extends Link<T> {
12 const factory EmptyLink() = LinkTail<T>; 14 const factory EmptyLink() = LinkTail<T>;
13 } 15 }
14 16
15 class AbstractLink<T> implements Link<T> { 17 class AbstractLink<T> implements Link<T> {
16 const AbstractLink(); 18 const AbstractLink();
(...skipping 18 matching lines...) Expand all
35 Link<Fisk> nodes = const EmptyLink<Fisk>(); 37 Link<Fisk> nodes = const EmptyLink<Fisk>();
36 final int id; 38 final int id;
37 Fisk(this.id); 39 Fisk(this.id);
38 toString() => id.toString(); 40 toString() => id.toString();
39 } 41 }
40 42
41 main() { 43 main() {
42 new Fisk(0).nodes.prepend(new Fisk(1)).prepend(new Fisk(2)); 44 new Fisk(0).nodes.prepend(new Fisk(1)).prepend(new Fisk(2));
43 } 45 }
44 46
OLDNEW
« no previous file with comments | « tests/language/factory2_test.dart ('k') | utils/apidoc/mdn/extract.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698