f78b2bcad9
The type of the `onError` parameter of Future<T>.catchError is just Function, but the function can either have signature `FutureOr<T> Function(dynamic)` or `FutureOr<T> Function(dynamic, StackTrace)`. This change adds checks for return statements in a function literal passed to `onError`, and the return type of a function-typed expression passed to `onError`. We still need to check parameter types. https://github.com/dart-lang/sdk/issues/35825 Change-Id: I806d9d30e595fb9d63ae669f3c30c428b60fdf4a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180880 Commit-Queue: Samuel Rawlins <srawlins@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>