-
Notifications
You must be signed in to change notification settings - Fork 218
Open
Labels
featureProposed language feature that solves one or more problemsProposed language feature that solves one or more problems
Description
Feature request
When we have a variable FutureOr<int> futureOr
, await futureOr
should run synchronously when the variable is not a Future
(see https://stackoverflow.com/q/59213196/6509751).
Current situation
At the moment, you need to use the following code if you want to run the evaluation synchronously when possible:
if (futureOr is int)
print(futureOr + 9);
else
print((await futureOr) + 9);
rrousselGit, mpfaff and jamesderlin
Metadata
Metadata
Assignees
Labels
featureProposed language feature that solves one or more problemsProposed language feature that solves one or more problems