Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow analysis. In a do-while loop an assignment in while after break is dead code #60361

Open
sgrekhov opened this issue Mar 19, 2025 · 0 comments
Labels
area-dart-model For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer. fe-analyzer-shared-flow-analysis model-flow Implementation of flow analysis in analyzer/cfe type-question A question about expected behavior or functionality

Comments

@sgrekhov
Copy link
Contributor

sgrekhov commented Mar 19, 2025

UPD. Seems that according to the #42232 (comment) the below is not an issue but an expected behavior. Please confirm.

The code below produces no compile-time errors in either CFE or the analyzer.

main() {
  late int i;
  do {
    break;
  } while ((i = 42) < 0);
  i; // Definitely unassigned but no compile-time error
}

cc @stereotype441

Dart SDK version: 3.8.0-197.0.dev (dev) (Sat Mar 15 17:07:22 2025 -0700) on "windows_x64"

@sgrekhov sgrekhov added fe-analyzer-shared-flow-analysis model-flow Implementation of flow analysis in analyzer/cfe type-question A question about expected behavior or functionality labels Mar 19, 2025
@a-siva a-siva added the area-dart-model For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer. label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-model For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer. fe-analyzer-shared-flow-analysis model-flow Implementation of flow analysis in analyzer/cfe type-question A question about expected behavior or functionality
Projects
None yet
Development

No branches or pull requests

2 participants