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

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

Issue 8591025: Fix parsing of factory calls (issue 500). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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
« no previous file with comments | « tests/co19/co19-runtime.status ('k') | tests/language/src/SavannahTest.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 // Dart test program for testing factories.
5
6 interface Link<T> extends Iterable<T> factory LinkFactory {
7 Link(T head, [Link<T> tail]);
8 Link<T> prepend(T element);
9 }
10
11 interface EmptyLink<T> extends Link<T> factory LinkTail<T> {
12 const EmptyLink();
13 }
14
15 class LinkFactory {
16 factory Link<T>(head, [Link tail]) {
17 }
18 }
19
20 class AbstractLink<T> implements Link<T> {
21 const AbstractLink();
22 Link<T> prepend(T element) {
23 return new Link<T>(element, this);
24 }
25 }
26
27 class LinkTail<T> extends AbstractLink<T> implements EmptyLink<T> {
28 const LinkTail();
29 }
30
31 class LinkEntry<T> extends AbstractLink<T> {
32 LinkEntry(T head, Link<T> realTail);
33 }
34
35 class Fisk {
36 Link<String> nodes = const EmptyLink();
37 }
38
39 main() {
40 new Fisk();
41 new EmptyLink<String>().prepend('hest');
42 const EmptyLink<String>().prepend('fisk');
43 }
44
OLDNEW
« no previous file with comments | « tests/co19/co19-runtime.status ('k') | tests/language/src/SavannahTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698