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

Convert to async function body refactoring should handle FutureOr return types #55773

Open
pattobrien opened this issue May 19, 2024 · 0 comments
Labels
analyzer-assist Issues with analysis server assists analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@pattobrien
Copy link

pattobrien commented May 19, 2024

Description

Given a return type of FutureOr<Foo>, the code assist Convert to async function body improperly adds another Future to the return type, resulting in a new return type of Future<FutureOr<Foo>>.

Before assist:

@override
  FutureOr<void> buildDefinitionForMethod(
    MethodDeclaration method,
    FunctionDefinitionBuilder builder,
  ) { /* ... */ }

After assist:

@override
  Future<FutureOr<void>> buildDefinitionForMethod(
    MethodDeclaration method,
    FunctionDefinitionBuilder builder,
  ) async { /* ... */ }

Info

Dart SDK version: 3.5.0-159.0.dev (dev) (Wed May 15 13:03:12 2024 -0700) on "macos_arm64"

@lrhn lrhn added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label May 19, 2024
@scheglov scheglov added P3 A lower priority bug or feature request analyzer-server analyzer-assist Issues with analysis server assists labels May 19, 2024
@srawlins srawlins added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-assist Issues with analysis server assists analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants