Skip to content

Analyzer flags too much code as dead in try/finally statements #48258

@stereotype441

Description

@stereotype441

Consider the following code:

main() {
  try {
    foo();
    print('dead');  // (1)
  } finally {
    print('alive'); // (2)
  }                 // (3)
}
Never foo() => throw 'exception';

If I look at this program in IntelliJ, all four lines from (1) to (3) are grayed out, indicating they are dead code. But if I run the program, it prints alive before exiting, indicating line (2) is not dead.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions