-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
"Create missing overrides" fix creates incorrect linkedEditGroups, causing invalid code #41147
Comments
Hit this with a simpler repro today. What I can't figure out, is why it only occurs in a Flutter project. If I use the exact same Dart SDK (from the flutter/bin/cache/dart-sdk) in a Dart project, it generates the correct code. class Foo extends Bar {}
abstract class Bar {
void update(double t);
void render(String c);
} Run "Create missing overrides" on Foo, and in a Flutter project it'll use |
@bwilkerson this seems to be coming up quite a bit lately - not sure if you've seen this though, as it hasn't been tagged as much as other analyzer issues. I haven't been able to figure out why it only seems to happen in Flutter projects, doesn't seem like that should affect something like this. |
This has been fixed (#42468). |
Also encountered this problem (VSCode). class ShipmentActivityInfo {}
abstract class ShipmentRepository {
Future<void> addActivities(List<ShipmentActivityInfo> activities);
Future<void> deleteActivitiesByTrack(String trackNumber);
Future<List<ShipmentActivityInfo>> getActivitiesByTrack(String trackNumber);
}
class ShipmentRepositoryImpl extends ShipmentRepository {} |
Moving this from Dart-Code/Dart-Code#2307 as it looks like a server issue. I can repro in both VS Code and Android Studio, though only in a Flutter project, not using the Dart SDK directly (I can't explain this bit, but I tried with a few recent Flutter SDKs and the latest dev + nightly Dart SDK, and it occurred only in the Flutter projects).
In a Flutter project, create a file with the following code:
Invoke "create 2 missing overrides" on
class A
and you'll end up with code like:This seems to occur, because
linkedEditGroups
are generated that bundleString
from both methods together, and also the argumentstoken
andphoneNumber
together - but they have only a singlelength
per group, so the length ofphoneNumber
is applied totoken
which results in some unwanted characters:The text was updated successfully, but these errors were encountered: