# TSR0703: Assertion '…' is not proved: the function can return normally with '…' of type '…'.

> An assertion function ('asserts x is T') can return normally when x isn't T. Throw on every path that doesn't prove it.

## What it means

For `asserts x is T`, the parameter's flow type at every normal return must be assignable to `T`; for `asserts x`, it must be narrowed to truthy. An assertion function that logs instead of throwing lets callers continue with the wrong type. It's reported at the assertion in the signature.

## Example

```ts
// An assertion function that can return normally with a non-number.
function assertNumber(x: unknown): asserts x is number { // @expect TSR0703
  if (typeof x !== "number") console.warn("not a number");
}
const v: unknown = "a";
assertNumber(v);
export const n: number = v;
```

## How to fix

- Throw on every path where the condition fails.
- Or use `assert<T>(x)` from `@ts-r.dev/guard`, which is generated from the type.

Sound mode is defined in [design record 0007](https://github.com/Webb-Ventures/typescript-rust/blob/main/docs/design/0007-sound-mode.md) (accepted 2026-10-15).

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