Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Change signature of methods overriding Future.then #7

Merged
merged 3 commits into from
Oct 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.11.3

* Fix strong-mode warning against the signature of Future.then

## 1.11.1

* Fix new strong-mode warnings introduced in Dart 1.17.0.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/delegate/future.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DelegatingFuture<T> implements Future<T> {
Future<T> catchError(Function onError, {bool test(Object error)}) =>
_future.catchError(onError, test: test);

Future/*<S>*/ then/*<S>*/(/*=S*/ onValue(T value), {Function onError}) =>
Future/*<S>*/ then/*<S>*/(dynamic onValue(T value), {Function onError}) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What SDK version did this change in? We should set the minimum SDK constraint to that version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this particular bit changed in 1.19

_future.then(onValue, onError: onError);

Future<T> whenComplete(action()) => _future.whenComplete(action);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/typed/future.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TypeSafeFuture<T> implements Future<T> {
Future<T> catchError(Function onError, {bool test(Object error)}) async =>
new TypeSafeFuture<T>(_future.catchError(onError, test: test));

Future/*<S>*/ then/*<S>*/(/*=S*/ onValue(T value), {Function onError}) =>
Future/*<S>*/ then/*<S>*/(dynamic onValue(T value), {Function onError}) =>
_future.then((value) => onValue(value as T), onError: onError);

Future<T> whenComplete(action()) =>
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: async
version: 1.11.2
version: 1.11.3
author: Dart Team <misc@dartlang.org>
description: Utility functions and classes related to the 'dart:async' library.
homepage: https://www.github.com/dart-lang/async
Expand All @@ -10,4 +10,4 @@ dev_dependencies:
stack_trace: "^1.0.0"
test: "^0.12.0"
environment:
sdk: ">=1.12.0 <2.0.0"
sdk: ">=1.19.0 <2.0.0"