Skip to content

Migration tool doesn't recognize Never in flow control #44420

Closed
@nex3

Description

@nex3

The migration tool doesn't recognize the effect functions that return Never have on the control flow of a function. Consider the following unmigrated code:

Never bail() => throw "oh no";

int foo() {
  int a;
  if (a == null) bail();
  return a;
}

The migrator correctly tries to change int a to int? a but it also tries to change int foo() to int? foo(), which is unnecessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NNBDIssues related to NNBD ReleaseP2A bug or feature request we're likely to work onarea-migration (deprecated)Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool).customer-dart-sasstype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions