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

Unified Diff: sdk/lib/async/future_impl.dart

Issue 2722203002: Use FutureOr in Completer.complete. (Closed)
Patch Set: Merge to head for relanding. Created 3 years, 10 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
« no previous file with comments | « sdk/lib/async/future.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/future_impl.dart
diff --git a/sdk/lib/async/future_impl.dart b/sdk/lib/async/future_impl.dart
index eb13318ef7f797d2d4552c74b7c81aa2a1a3a014..844646bbd53f2dd62252dba707d79ed56cbf811a 100644
--- a/sdk/lib/async/future_impl.dart
+++ b/sdk/lib/async/future_impl.dart
@@ -14,7 +14,7 @@ typedef _FutureAction();
abstract class _Completer<T> implements Completer<T> {
final _Future<T> future = new _Future<T>();
- void complete([value]);
+ void complete([FutureOr<T> value]);
void completeError(Object error, [StackTrace stackTrace]) {
error = _nonNullError(error);
@@ -36,7 +36,7 @@ abstract class _Completer<T> implements Completer<T> {
class _AsyncCompleter<T> extends _Completer<T> {
- void complete([value]) {
+ void complete([FutureOr<T> value]) {
if (!future._mayComplete) throw new StateError("Future already completed");
future._asyncComplete(value);
}
@@ -47,7 +47,7 @@ class _AsyncCompleter<T> extends _Completer<T> {
}
class _SyncCompleter<T> extends _Completer<T> {
- void complete([value]) {
+ void complete([FutureOr<T> value]) {
if (!future._mayComplete) throw new StateError("Future already completed");
future._complete(value);
}
« no previous file with comments | « sdk/lib/async/future.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698