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

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

Issue 8948001: Updates dartc to recognize 'default' keyword on interface and updated factory method syntax (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Feedback from mmendez 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
« no previous file with comments | « tests/language/language.status ('k') | tests/language/src/Factory3Test.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) 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> factory 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> factory 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]) {
17 } 17 }
18 } 18 }
19 19
20 class AbstractLink<T> implements Link<T> { 20 class AbstractLink<T> implements Link<T> {
21 const AbstractLink(); 21 const AbstractLink();
(...skipping 13 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 | « tests/language/language.status ('k') | tests/language/src/Factory3Test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698