diff --git a/sdk_nnbd/lib/cli/wait_for.dart b/sdk_nnbd/lib/cli/wait_for.dart index de3cce5f3ae..b24fd4dc2c9 100644 --- a/sdk_nnbd/lib/cli/wait_for.dart +++ b/sdk_nnbd/lib/cli/wait_for.dart @@ -111,12 +111,12 @@ class _WaitForUtils { * subsequent calls block waiting for a condition that is only satisfied when * an earlier call returns. */ -T? waitFor(Future future, {Duration? timeout}) { - late T? result; +T waitFor(Future future, {Duration? timeout}) { + late T result; bool futureCompleted = false; Object? error; StackTrace? stacktrace; - future.then((r) { + future.then((T r) { futureCompleted = true; result = r; }, onError: (e, st) {