Skip to content

Commit

Permalink
Use FutureOr for more precise typing (#146)
Browse files Browse the repository at this point in the history
This fixes some internal google usages.
  • Loading branch information
vsmenon authored and goderbauer committed Apr 6, 2017
1 parent 0cd94fa commit d020c42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/support/async.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

library webdriver.support.async;

import 'dart:async' show Completer, Future;
import 'dart:async' show Completer, Future, FutureOr;

import 'package:matcher/matcher.dart' as m;
import 'package:stack_trace/stack_trace.dart' show Chain;
Expand All @@ -25,7 +25,7 @@ const defaultTimeout = const Duration(seconds: 5);

const clock = const Clock();

Future<T> waitFor<T>(T condition(),
Future<T> waitFor<T>(FutureOr<T> condition(),
{matcher: null,
Duration timeout: defaultTimeout,
Duration interval: defaultInterval}) =>
Expand All @@ -50,7 +50,7 @@ class Clock {
/// is returned. Otherwise, if [condition] throws, then that exception is
/// rethrown. If [condition] doesn't throw then an [expect] exception is
/// thrown.
Future<T> waitFor<T>(T condition(),
Future<T> waitFor<T>(FutureOr<T> condition(),
{matcher: null,
Duration timeout: defaultTimeout,
Duration interval: defaultInterval}) async {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: >
and as such, require the use of the WebDriver remote server.
homepage: https://github.com/google/webdriver.dart
environment:
sdk: '>=1.21.1 <2.0.0'
sdk: '>=1.22.0 <2.0.0'
dependencies:
archive: '^1.0.0'
matcher: '^0.12.0'
Expand Down

0 comments on commit d020c42

Please sign in to comment.