Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

future doesn't throw correctly inside try block #55970

Closed
SamMotta opened this issue Jun 10, 2024 · 1 comment
Closed

future doesn't throw correctly inside try block #55970

SamMotta opened this issue Jun 10, 2024 · 1 comment
Labels
closed-duplicate Closed in favor of an existing report

Comments

@SamMotta
Copy link

Flutter 3.22.1
Dart 3.4.1

packages: riverpod and fpdart

I use unnecessary_await_in_return lint

Code:
image

image

if await is removed in first image, it doesn't throw like intended.

@SamMotta SamMotta changed the title Create an issue future doesn't throw correctly inside try block Jun 10, 2024
@lrhn
Copy link
Member

lrhn commented Jun 10, 2024

Known issue. The await is not unnecessary if you are returning a future inside a try/catch, because of a long-standing bug in returning futures.

See: #44395

@lrhn lrhn closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2024
@lrhn lrhn added the closed-duplicate Closed in favor of an existing report label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

2 participants