-
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-warningIssues with the analyzer's Warning codesIssues with the analyzer's Warning codesmodel-flowImplementation of flow analysis in analyzer/cfeImplementation of flow analysis in analyzer/cfetype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
The following code works wihout issues in both CFE and the analyzer.
void test(Never n) {
late int i;
for (;n;) {
i = 42; // No dead code warning here
}
i; // No error here
}But i = 42 is dead code; there is no way to avoid executing the second operand of the for(;;) loop. Flow analysis should detect this, and i; should produce an error because i is definitely unassigned here.
Dart SDK version: 3.8.0-66.0.dev (dev) (Sun Feb 2 20:05:47 2025 -0800) on "windows_x64"
eernstg and FMorschel
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-warningIssues with the analyzer's Warning codesIssues with the analyzer's Warning codesmodel-flowImplementation of flow analysis in analyzer/cfeImplementation of flow analysis in analyzer/cfetype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)