You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Future return type is correct and precise, the async function will return a Future, so I don't think it's unreasonable to update the return type.
If you still want a FutureOr return type for some reason, it should be easy to change it back, but most likely you won't need that. The Future return type is a valid override of a superinterface FutureOr type, so unless you expect subclasses to override again and return a FutureOr, it shouldn't matter.
It is a little inconsistent, though.
If you look at the quick-fix used on the following examples:
where it changes the return type to Future<int?>.
(Which may be reasonable from the perspective that any existing valid return v; statement will stay valid, including return null, but that does not explain that qux stays Future<int>?.)
Something is inconsistent. One of qux and biff should behave like the other (or the type should just not be changed if it already has a future value type).
@lrhn Because the user has already specified "FutureOr" in the input I did not expect the linter to replace it with another type, but that true that FutureOr is not necessary here so this is fine. that would not be good if FutureOr were necessary
Input code:
The await expression can only be used in an async function. Try marking the function body with either 'async' or 'async*'.
Apply quick fix:
Expected code:
The text was updated successfully, but these errors were encountered: