-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-uxtype-questionA question about expected behavior or functionalityA question about expected behavior or functionality
Description
Analyzer produces a warning in case of use of null-check and null-asser patterns on a constant of nullable type.
const int? one = 1;
main() {
int x = 1;
if(x case one?) { // unnecessary_null_check_pattern warning
print("One");
}
if(x case one!) { // unnecessary_null_assert_pattern warning
print("One");
}
}Please confirm if it is really intended.
cc @eernstg
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-uxtype-questionA question about expected behavior or functionalityA question about expected behavior or functionality