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

Side by Side Diff: tests/language/factory2_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/corelib/iterable_length_test.dart ('k') | tests/language/factory3_test.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 4
5 abstract class Link<T> extends Iterable<T> { 5 import "dart:collection";
6
7 abstract class Link<T> extends IterableBase<T> {
6 // does not match constructor for LinkFactory 8 // does not match constructor for LinkFactory
7 factory Link(T head, [Link<T> tail]) = LinkFactory<T>; /// static type warning 9 factory Link(T head, [Link<T> tail]) = LinkFactory<T>; /// static type warning
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 LinkFactory<T> { 17 class LinkFactory<T> {
(...skipping 25 matching lines...) Expand all
41 } 43 }
42 44
43 main() { 45 main() {
44 new Fisk(); 46 new Fisk();
45 // instantiation of abstract class 47 // instantiation of abstract class
46 new EmptyLink<String>().prepend('hest'); /// static type warning 48 new EmptyLink<String>().prepend('hest'); /// static type warning
47 // instantiation of abstract class 49 // instantiation of abstract class
48 const EmptyLink<String>().prepend('fisk'); /// static type warning 50 const EmptyLink<String>().prepend('fisk'); /// static type warning
49 } 51 }
50 52
OLDNEW
« no previous file with comments | « tests/corelib/iterable_length_test.dart ('k') | tests/language/factory3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698