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

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

Issue 2647833002: fix #28008, fix #28009 implement FutureOr<T> (Closed)
Patch Set: Merge remote-tracking branch 'origin/master' into 28008_futureort Created 3 years, 11 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') | tests/lib/async/future_or_bad_type_test.dart » ('j') | 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 6e0b55b4db35efc829b9550b5e901a75c721ba30..4e6ba423446fee6bf1eebe606b319ffbc72e26c8 100644
--- a/sdk/lib/async/future_impl.dart
+++ b/sdk/lib/async/future_impl.dart
@@ -231,11 +231,11 @@ class _Future<T> implements Future<T> {
}
Future<E> then<E>(
- dynamic/*E|Future<E>*/ f(T value), { Function onError }) {
+ FutureOr<E> f(T value), { Function onError }) {
Zone currentZone = Zone.current;
ZoneUnaryCallback registered;
if (!identical(currentZone, _ROOT_ZONE)) {
- f = currentZone.registerUnaryCallback<dynamic, T>(f);
+ f = currentZone.registerUnaryCallback<FutureOr<E>, T>(f);
if (onError != null) {
onError = _registerErrorHandler<T>(onError, currentZone);
}
« no previous file with comments | « sdk/lib/async/future.dart ('k') | tests/lib/async/future_or_bad_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698