8000 Convert all formal parameters to named doesn't handle super parameters well · Issue #55068 · dart-lang/sdk · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Convert all formal parameters to named doesn't handle super parameters well #55068

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

Open
bwilkerson opened this issue Feb 29, 2024 · 3 comments
Open
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-refactoring Issues with analysis server refactorings P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@bwilkerson
Copy link
Member

I'm not sure whether there's anything we can reasonably do here, but given the code

class A {
  int a;
  A(this.a);
}

class B extends A {
  B(super.a);
}

If you select the constructor for A and ask to "Convert all formal parameters to named", the parameter "super.a" won't be changed and results in a compilation error.

Selecting the constructor for B and performing the same operation will fix the code, but it isn't clear that the constructor in B should be modified when refactoring the constructor in A.

Performing the refactorings in the other order (converting B first and then A) will also result in compilation errors until both have been converted.

@bwilkerson bwilkerson added legacy-area-analyzer Use area-devexp instead. devexp-refactoring Issues with analysis server refactorings labels Feb 29, 2024
@bwilkerson
Copy link
Member Author

@scheglov In case you have ideas (other than "use a real IDE" 😄 )

@scheglov scheglov self-assigned this Feb 29, 2024
@scheglov
Copy link
Contributor

Yes, support for constructors, specifically for super formal parameters is not fully ready.
I will look at these when I have more spare time.

@scheglov
Copy link
Contributor
scheglov commented Mar 5, 2024

https://dart-review.googlesource.com/c/sdk/+/355505 should make sure that we don't suggest partial changes.

@bwilkerson bwilkerson added the P2 A bug or feature request we're likely to work on label Mar 13, 2024
@srawlins srawlins added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Mar 15, 2024
@bwilkerson bwilkerson added area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. and removed legacy-area-analyzer Use area-devexp instead. labels Feb 21, 2025
@scheglov scheglov removed their assignment Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-refactoring Issues with analysis server refactorings P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants
0