# TS7027: Unreachable code detected.

> Code after a `return`, `throw`, `break` or `continue` can never run. Remove it or fix the control flow above it.

## What it means

The binder found statements that can't be reached because the code before them always exits.
It is reported when `allowUnreachableCode` is `false`; with the option unset, editors show the
code faded instead of reporting an error.

## Example

```json
{ "compilerOptions": { "allowUnreachableCode": false } }
```

```ts
export function f(): number {
  return 1;
  console.log("done");
}
```

## How to fix

- Delete the unreachable statements, or move them before the `return`.
- If the early exit is a mistake (for example a stray `return`), fix that instead.

Source: https://ts-r.dev/errors/TS7027/
