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

Nonsensical error message on variable rename #3159

Closed
larssn opened this issue Feb 24, 2021 · 2 comments
Closed

Nonsensical error message on variable rename #3159

larssn opened this issue Feb 24, 2021 · 2 comments
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Milestone

Comments

@larssn
Copy link

larssn commented Feb 24, 2021

Describe the bug
Renaming date to now fails with:
Usage of constructor "DateTime.now" declared in "date_time.dart" will be shadowed by renamed local variable.

test() {
  final date = DateTime.now();
}

To Reproduce
Steps to reproduce the behavior:

  1. Try the above

Expected behavior
now is a valid name, and shouldn't fail. It also doesn't shadow anything, as it seems to think.

Versions (please complete the following information):

  • VS Code version: 1.53.2
  • Dart extension version: 3.19.2
  • Dart/Flutter SDK version: >=2.10.0 <3.0.0
@larssn larssn added the is bug label Feb 24, 2021
@DanTup
Copy link
Member

DanTup commented Feb 24, 2021

Thanks for the report! I can reproduce this - the message is coming from the language server so I've filed dart-lang/sdk#45105. Thanks!

@DanTup DanTup added in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug and removed is bug labels Feb 24, 2021
@DanTup DanTup added this to the v3.21.0 milestone Feb 24, 2021
@DanTup
Copy link
Member

DanTup commented Feb 25, 2021

This has been fixed by dart-lang/sdk@526e191 and will be included in a future Dart/Flutter SDK update. Thanks!

@DanTup DanTup closed this as completed Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Projects
None yet
Development

No branches or pull requests

2 participants