You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nonsensical error message on variable rename #3159
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:
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):
Activity
DanTup commentedon 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 commentedon Feb 25, 2021
This has been fixed by dart-lang/sdk@526e191 and will be included in a future Dart/Flutter SDK update. Thanks!