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:
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):
Thanks for the report! I can reproduce this - the message is coming from the language server so I've filed https://github.com/dart-lang/sdk/issues/45105. Thanks!
This has been fixed by https://github.com/dart-lang/sdk/commit/526e191a57b7399f0de3e09bd8f2bed6c066d0b1 and will be included in a future Dart/Flutter SDK update. Thanks!