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

Unified Diff: lib/core/future.dart

Issue 10950006: Convert most interfaces in dart:core to abstract classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: lib/core/future.dart
diff --git a/lib/core/future.dart b/lib/core/future.dart
index 148620295e1fb087f5d48e5aee7c1dbd6917cf7f..8c7207a3bea14eaa47a7271dafb6c5fc44eb866d 100644
--- a/lib/core/future.dart
+++ b/lib/core/future.dart
@@ -27,10 +27,9 @@
*
* Use a [Completer] to create and change the state of a [Future].
*/
-interface Future<T> default FutureImpl<T> {
-
+abstract class Future<T> {
/** A future whose value is immediately available. */
- Future.immediate(T value);
+ factory Future.immediate(T value) => new FutureImpl<T>.immediate(value);
/** The value provided. Throws an exception if [hasValue] is false. */
T get value;
@@ -158,9 +157,9 @@ interface Future<T> default FutureImpl<T> {
* completer.completeException(exception);
*
*/
-interface Completer<T> default CompleterImpl<T> {
+abstract class Completer<T> {
- Completer();
+ factory Completer() => new CompleterImpl<T>();
/** The future that will contain the value produced by this completer. */
Future get future;
@@ -198,7 +197,6 @@ class FutureAlreadyCompleteException implements Exception {
* example, waiting for a collection of Futures to complete).
*/
class Futures {
-
/**
* Returns a future which will complete once all the futures in a list are
* complete. If any of the futures in the list completes with an exception,

Powered by Google App Engine
This is Rietveld 408576698