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
mraleph
added
closed-as-intended
Closed as the reported issue is expected behavior
and removed
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
labels
Jan 13, 2025
For those curious: extension NotEmptyOrThrowTExtension<String> on String? means that String is actually a type parameter name shadowing String class from dart:core (i.e. it is the same as extension NotEmptyOrThrowTExtension<T> on T?) - hence the error. Removing <String> would fix it.
I think at some point we considered adding code to the analyzer to warn about such shadowing, because people periodically fall into this trap) but probably never got to it.
https://dart-review.googlesource.com/c/sdk/+/381841 will change avoid_types_as_parameter_names such that this kind of shadowing is reported. Internal code is being adjusted such that the change won't be breaking inside Google.
Snippet
Actual behavior
Expected behavior
isEmpty
is recognized.Version
Dart SDK version: 3.5.4 (stable) (Wed Oct 16 16:18:51 2024 +0000) on "macos_arm64"
The text was updated successfully, but these errors were encountered: