An unreachable statement almost always indicates missing code or a latent bug and should be examined carefully.

Examine the surrounding code to determine why the statement has become unreachable. If it is no longer needed, remove the statement.

In the following example, a spurious semicolon after the if condition at line 2 makes the return statement on line 4 unreachable: the function will always execute the return statement on line 3 first, so it will never reach line 4.

To correct this issue, remove the spurious semicolon:

  • Wikipedia: Unreachable code.