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

dart fix applies the wrong fix for always-specify-types in const collection literals. #52219

Closed
water-mizuu opened this issue Apr 29, 2023 · 2 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on

Comments

@water-mizuu
Copy link

  • Dart SDK Version: Dart SDK version: 3.1.0-46.0.dev (dev) (Tue Apr 25 23:35:50 2023 -0700) on "windows_x64"
  • Windows 11

So the issue is, when applying fixes for the rule always-specify-types as stated above, the result can be seen in this snippet of code:

/// Before applying the fix
Matrix<E> removed({Set<int> x = const {}, Set<int> y = const {}}) { ... }
/// After applying the fix
Matrix<E> removed({Set<int> x = <int>const {}, Set<int> y = <int>const {}}) { ... }
/// Expected behavior
Matrix<E> removed({Set<int> x = const <int>{}, Set<int> y = const <int>{}}) { ... }
@mraleph mraleph added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label May 1, 2023
@mraleph
Copy link
Member

mraleph commented May 1, 2023

/cc @pq @scheglov

@scheglov scheglov added the P2 A bug or feature request we're likely to work on label May 1, 2023
@scheglov scheglov self-assigned this May 1, 2023
@scheglov
Copy link
Contributor

scheglov commented May 1, 2023

copybara-service bot pushed a commit that referenced this issue May 1, 2023
Bug: #52219
Change-Id: Iab4d63142f08789fa7bd1b46e2f4ba8e696a1fe8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300162
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
@scheglov scheglov closed this as completed May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

3 participants